allow disabling auto imports
See original GitHub issueDescribe the feature
First mentioned here by @nikolay-zoteev and @cawa-93 in https://github.com/nuxt/framework/discussions/2271.
I would like to be able to disable auto import, so I can make explicit imports from respective vendor library required in the codebase.
import { ref } from '#imports'
Would become:
import { ref } from 'vue'
Additional, from https://github.com/nuxt/framework/discussions/2271#discussioncomment-2906232:
I still need a reliable and documented way to turn off auto-import.
- Auto-import does not work for the server part
- Auto-import doesn’t work for everyone. You still have business logic modules, helpers, utilities, services that you have to import on your own (actually IDE will do everything for you).
- Only top level files can be auto-imported.
- Auto-import of asynchronous components (such as those created by
defineAsyncComponent
) is not possible.In addition
- Auto-import complicates IDE code analysis (jet brains have issues with deep import analysis)
- It takes twice as long to go from calling a component to declaring it
Additional information
- Would you be willing to help implement this feature?
- Could this feature be implemented as a module?
Final checks
- Read the contribution guide.
- Check existing discussions and issues.
Issue Analytics
- State:
- Created a year ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
D78923 [LLD] [COFF] Add options for disabling auto import ...
Allow disabling either the full auto import feature, or just forbidding the cases that require runtime fixups. As long as all auto imported...
Read more >rdar://FB9816645: Remove auto import or make a setting to be ...
I want to disable this now. Also every so often during a code review I will notice that some random resource is being...
Read more >Auto import | IntelliJ IDEA Documentation - JetBrains
Disable auto import . If you want to completely disable auto-import, make sure that: All import tooltips are disabled.
Read more >How to disable automatic import statements in VsCode ...
Updated for new version of VSCode 2019 for using the UI to modify the setting. So choose the File > Preference > Setting...
Read more >Auto Import -- how to disable? - Adobe Support Community
I believe Canon software on a Mac allows you to specify what program is launched when you hook up your camera to the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
In addition to @danielroe’s note:
Supported since https://github.com/nuxt/framework/pull/6025
This is a reasonable request, but just to address some of your comments:
You can configure this with
autoImports.dirs
Auto imports can be configured for nitro within
nitro.autoImport
You can use
resolveComponent('SomeAsyncComponent')
if they are registered or marked as global components.