N
Nuxt5mo ago
exophunk

Disable auto-import "utils/" folder, but keep others folders

I can completely disable auto-import with
export default defineNuxtConfig({
imports: {
autoImport: false
}
})
export default defineNuxtConfig({
imports: {
autoImport: false
}
})
https://nuxt.com/docs/guide/concepts/auto-imports#disabling-auto-imports I can also specify other paths to auto-import :
imports: {
dirs: [
'configs/**',
'types/**',
],
},
imports: {
dirs: [
'configs/**',
'types/**',
],
},
but it seems I have no option to disable "utils" or "composables" to be auto-imported. the "dirs" folder config is extending - not replacing - the directories. I would like to just auto-import configs, types as above, but disable importing utils? is there a way to configure that?
1 Reply
Cue
Cue5mo ago
Use the 'imports:dirs' hook, and remove the utils folder.

Did you find this page helpful?