Snippets - Nuxt

Disable auto imports in Nuxt

|
Anuz Pandey

In Nuxt, you can disable automatic imports entirely by setting the imports.scan option to false in you nuxt.config.js file.

This ignores all directories listed in imports.dirs options. Additionally, this will ignore auto imports of all the composables, and utils directories as well.

If you want to disable auto imports for components as well, you can set the components value to an empty array.

Keep coding, keep exploring and inspiring. 🐼


  • Tags:
  • nuxt
  • tips-and-tricks