chore(docs): restructure docs so they can be ingested by svelte.dev
#1201 yesterday • Aug 18, 2025feat: enable optimizer for server environments during dev
#1185 20 days ago • Jul 30, 2025prevent modification of internal api/config
#1173 20 days ago • Jul 30, 2025vite-plugin-svelte:config
. This can produce hard to track bugs
Describe the proposed solution
Use deepFreeze or a proxy with throw in set to prevent modifications.
Currently options.server
is used to keep a reference to the vite devserver. This must not be frozen so we have to skip it somehow or move it out of our api for this to work.
Alternatives considered
leave it as is, check our codebase that we don't expose more through vites config hooks.
Also see with vite why their config logic just took the array ref we gave it instead of pulling out the elements.
Importance
would make my life easierOptimizing for server environments
#1181 20 days ago • Jul 30, 2025@cloudflare/vite-plugin
, most deps are prebundled before they are loaded by the workerd
runtime during development. This means that the esbuild optimizer plugin should generate server code in these cases instead of always generating client code. https://github.com/sveltejs/vite-plugin-svelte/blob/3119a4b53f36835a5a8d28b19cfb7c47abb8bbbd/packages/vite-plugin-svelte/src/plugins/setup-optimizer.js#L199
This is important to enable SvelteKit to work with the Cloudflare Vite plugin in development, which currently receives client Svelte code when performing SSR.
Describe the proposed solution
The Svelte compiler generates client/server code depending on the Vite environment when optimizing dependencies.
EDIT: sapphi mentioned it's possible to set a different esbuild plugin during the configureEnvironment
hook
Alternatives considered
If we waited for Rolldown to officially replace esbuild, we wouldn't need to bother with tweaking the esbuild plugin. But I think that might still be a long time from now.
We could also probably workaround this by ensuring SvelteKit doesn't get optimized during development.
Importance
I cannot use vite-plugin-svelte without itknown issues with rolldown-vite and svelte
#1143 Jul 2, 2025 if(condition)
from `esm-env' are not removed when the condition is false
https://github.com/rolldown/rolldown/issues/4786
https://github.com/rolldown/rolldown/issues/4258
https://github.com/vitejs/rolldown-vite/issues/229
This leads to larger output (eg development errorhandling is kept), but the app should still work as expected
server output can contain code that should only be added to client
https://github.com/rolldown/rolldown/issues/3403
This can lead to much larger output for server bundles, including broken apps.
Example:
svelte exports onMount
as a noop ()=>{}
unless the 'browser' exports condition is active so code like onMount(()=>doClientThings())
should not lead to any output for the server
If doClientThings imported a large library that expects browser globals to be available, it'll crash the server. Even if the app keeps working it can put large client only libraries into the server bundle which can be very bad on edge deployments.
emits empty css chunks
empty CSS chunks are emitted for each Svelte file and they're also not in the Vite manifest, causing read errors when sveltekit traverses CSS imports for mapping/inlining
https://github.com/vitejs/rolldown-vite/issues/267
dev
currently no known issues for vite dev
enableNativePlugins
css is not applied
https://github.com/vitejs/rolldown-vite/issues/213
support loading css first
#1032 Mar 12, 2025.svelte
files are imported as js module.
But with vite ?direct
or ?inline
query urls, it is possible that the first request is not for the js module but the css.
Describe the proposed solution
In case the cache is empty when css is requested, compile.
Alternatives considered
keep current behavior, styles might not be needed before the js module
Importance
nice to haveCan't inspect disabled elements
#997 Nov 1, 2024<button disabled>
or <input disabled>
it seems i can't inspect it
Reproduction URL
some other time, sorry
Reproduction
No response
Logs
No response
System Info
next
Docs on svelte.dev
#942 Jul 11, 2024vite-plugin-svelte
doesn't really have a docs index page currently. There's the readme, but we might put different content on svelte.dev than what's there. There also isn't a clear order the docs pages should be displayed in the lefthand nav
Describe the proposed solution
Prefix the existing docs with 10-
, 20-
, etc. to provide an ordering that can be used in the lefthand nav. The docs with the smallest prefix should include some introductory material
Alternatives considered
it may be helpful to update the directory structure of various repos to align with each other, but I think that isn't strictly necessary and we can maintain a mapping of where docs live in each repo
Importance
i cannot use vite-plugin-svelte without itsvelte/internal import guard
#861 Feb 21, 2024