Replies: 1 comment 2 replies
-
Personally i'm not a fan of these magic imports. They prevent static drpendency tracking and especially camelCase to path separators reads like a nightmare to support/unwind It may work with https://github.com/antfu/unplugin-auto-import buuut you'd need to see how to use it from a svelte preprocessor as the imports need to be present when svelte.compile is called. Maybe @userquin has an idea how it could be implemented. But tbh even if it works i'd not recommend using it. IDE support should autogenerate imports for you so this very minor dx improvement isn't worth the loss of information in file |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I think a good idea to break out even more of the import hell that React has is to utilize automatic component import.
Nuxt.js already does this perfectly: as seen here
You could also use the same syntax like Nuxt, for example:
A component in
src/lib/header/Navigation.Svelte
could resolve to<HeaderNavigation />
.Thus removing the need to import it manually if a component/page includes several other components.
Is this something considered?
Beta Was this translation helpful? Give feedback.
All reactions