npm / @sveltejs/vite-plugin-svelte
@sveltejs/vite-plugin-svelte
What changed in @sveltejs/vite-plugin-svelte 7, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-22.
7 breaking1 new APIs and options2 behavior and defaults1 tooling6 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli init@sveltejs/vite-plugin-svelte 717 changes
Breaking changes 7
The deprecated vite-plugin-svelte:api property is removed; use api.filter instead.
The property used by other Vite plugins is removed; update affected plugins to a newer version or remove them.
Svelte 5.46.4 or later is now required.
Vite 8 is now required.
The inspector is integrated into vite-plugin-svelte to avoid a circular dependency.
The deprecated option in svelte.config.js is removed; use compilerOptions.hmr instead.
The deprecated option in svelte.config.js is removed because it is no longer needed.
New APIs and options 1
dynamicCompileOptions now receives the environment, allowing its compile options to depend on it.
Behavior and default changes 2
The optimizer is enabled for server environments during development.
The plugin no longer overrides compilerOptions.cssHash because Svelte now produces a stable CSS hash by itself.
Tooling 1
The inspector adds a context menu showing the current component stack.
Fixes and other changes 6
Fixes inspector injection into the client under Vite+ on pnpm, where the realpathed client module has no vite/ segment before dist/.
Inline config is no longer logged when unexpected options are encountered.
Enforces left-to-right styles for the inspector.
Ensures the inspector is injected into the client correctly for Vite+ projects.
Correctly resolves compiled CSS on the server for dependencies with Svelte files.
vitePreprocess now passes this TypeScript option to transformWithOxc, preventing value imports from being dropped when referenced only in Svelte template markup.