A sneak peek

Tips from the book

Disable auto-imports

You can completely disable auto-imports by using the new imports.scan option:

export default defineNuxtConfig({
imports: {
scan: false,
},
});

This will ignore any directories listed in the imports.dirs option, as well as ignoring auto-imports for the ~/composables and ~/utils directories.

To also prevent auto-importing components, you’ll need to configure the components option as well:

export default defineNuxtConfig({
imports: {
scan: false,
},
// Set to an empty array
components: [],
});

This will make the imports in your project more explicit, so it’s clearer where things are coming from. Some developers prefer this because it adds to the readability of the code.