Open lukasaric opened 2 weeks ago
Hi, I believe the correct usage here is to just import explicitly from #imports
import { useScriptGoogleTagManager } from '#imports'
I'm open to adding a domain-specific alias for the registry scripts as I'm already using a few, but would need a valid use case.
#nuxt-scripts
-> types#nuxt-scripts-utils
-> utils#nuxt-scripts-validator
-> valibot or mockHi, I believe the correct usage here is to just import explicitly from
#imports
import { useScriptGoogleTagManager } from '#imports' I'm open to adding a domain-specific alias for the registry scripts as I'm already using a few, but would need a valid use case.
#nuxt-scripts
-> types#nuxt-scripts-utils
-> utils#nuxt-scripts-validator
-> valibot or mock
When you import it from #imports
it imports the wrong one đ .
Other than that, there are multiple issues in general with #imports (e.g go to definition
etc) so there are a lot reasons why it would be good improve imports and add aliases as you suggested. @harlan-zw
đ Your use case
If
Nuxt
project hasautoImports
turned off, when you want to import some composable from nuxt/scripts you need to do something like this:Which also does not work and it leads to this error:
đ The solution you'd like
Add Nuxt
aliases
or something similar so the developer can easily import composable or components explicitly.Example:
đ Alternatives you've considered
No response
âšī¸ Additional info
No response