vite-plugin-svelte icon indicating copy to clipboard operation
vite-plugin-svelte copied to clipboard

known issues with rolldown-vite and svelte

Open dominikg opened this issue 5 months ago • 2 comments

[!NOTE] This is a meta-issue, content below is updated but not guaranteed to be up2date or complete.

Please comment if something is fixed or an issue comes up that isn't listed here.

Issues mentioning svelte in rolldown-vite and rolldown

build

[!CAUTION] the issues mentioned below can lead to larger build output and broken applications, do not deploy in production.

  • [ ] fails to remove dead code

    code paths using 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

dominikg avatar Jun 17 '25 08:06 dominikg

added empty css chunks https://github.com/vitejs/rolldown-vite/issues/267

dominikg avatar Jun 18 '25 07:06 dominikg

added "css is not applied" and reformatted so that issue status is rendered on link

dominikg avatar Jun 18 '25 10:06 dominikg

marked https://github.com/vitejs/rolldown-vite/issues/213 as resolved, local testing with [email protected] shows css applied, emitted css for enableNativePlugin: true is equal to enableNativePlugin: false

dominikg avatar Jul 02 '25 10:07 dominikg

added https://github.com/rolldown/rolldown/issues/6945

dominikg avatar Nov 11 '25 19:11 dominikg