vite-plugin-svelte
vite-plugin-svelte copied to clipboard
improve integration for custom file extensions with vite
Describe the feature
Currently vite only knows that .svelte is transformed to js but svelte can be used with other extensions aswell (eg .svx , .svg )
- enhance vite to allow configuration of "extensions that transform to js"
- configure vite from vite-plugin-svelte with the extensions of svelte config.
A Usecase Resolve the current situation where non ".svelte" svelte components require ?import to be imported correctly
Alternatives Check out if the import marker could be added during resolveId?
Additional context ?import marker added in sveltekit: https://github.com/sveltejs/kit/blob/1c78dec3b65d407db70a555ff54cc11442dcdc07/packages/kit/src/core/dev/index.js#L254
initial PR on vite (needs to be rebased) https://github.com/vitejs/vite/pull/3219
new PR on vite https://github.com/vitejs/vite/pull/3828
unfortunately https://github.com/vitejs/vite/pull/3828 has been set to Draft and it is unclear how vite is handling this in the future. So for now we wait...