declare svelte and svelte-hmr as devDependencies in package.json of examples
frederikhors opened this issue · comments
Discover this project today! Congratulations! It's amazing!
Can I ask you why svelte
and svelte-hmr
are in the package.json
's dependencies
and not in the dev-dependencies
?
Thank you.
In case of svelte its simple. You're building svelte applications with svite and at least svelte/internal is going to be in the output of svite build
For svelte-hmr it is a bit more complicated. While svelte-hmr is not added to output created with svite build
it is added to output of svite dev
via generated code. So even if you don't include it yourself anywhere, it is used in an output.
In case of svelte its simple. You're building svelte applications with svite and at least svelte/internal is going to be in the output of svite build
Yes, but I don't understand; in the SvelteJS template they put svelte
in dependencies: https://github.com/sveltejs/template/blob/master/package.json.
For svelte-hmr I do not understand too.
Is the dep something we need in dev mode? So dev-dependencies; if not so don't.
Am I wrong?
Maybe this is because vitejs optimizes dependencies only? Like vitejs/vite#804 and vitejs/vite#720?
Thank you for mentioning this, i've learned something more about svelte today.
While svelte itself is used in application code, the svelte compiler produces output that does not rely on the svelte library.
So you are correct and both svelte and svelte-hmr should be devDependencies.
This has been changed in svite-0.7.0-beta.0, please test it with npx svite@beta create my-svite-beta-project
and let me know if that helps. This issue is going to be closed when 0.7 is out of beta.
examples have been updated to use svelte and svelte-hmr in devDependencies, svite-0.7.0 has been released with a breaking change notification about it.