# What changed in @sveltejs/vite-plugin-svelte

> 20 changes in @sveltejs/vite-plugin-svelte 6 to 7 from its official release notes, upgrade guides and advisories: 7 breaking, 1 new APIs and options. Each one cited. Sources checked 2026-10-22. HTML: https://unstale.sh/npm/@sveltejs/vite-plugin-svelte/

To see which of these apply to a repository, run `npx @unstale/cli init` in it.

## @sveltejs/vite-plugin-svelte 7

### Breaking changes

- The deprecated vite-plugin-svelte:api property is removed; use api.filter instead. (7.0.0) — [release notes](https://github.com/sveltejs/vite-plugin-svelte/releases/tag/%40sveltejs/vite-plugin-svelte%407.0.0)
- The property used by other Vite plugins is removed; update affected plugins to a newer version or remove them. (7.0.0) — [release notes](https://github.com/sveltejs/vite-plugin-svelte/releases/tag/%40sveltejs/vite-plugin-svelte%407.0.0)
- Svelte 5.46.4 or later is now required. (7.0.0) — [release notes](https://github.com/sveltejs/vite-plugin-svelte/releases/tag/%40sveltejs/vite-plugin-svelte%407.0.0)
- Vite 8 is now required. (7.0.0) — [release notes](https://github.com/sveltejs/vite-plugin-svelte/releases/tag/%40sveltejs/vite-plugin-svelte%407.0.0)
- The inspector is integrated into vite-plugin-svelte to avoid a circular dependency. (7.0.0) — [release notes](https://github.com/sveltejs/vite-plugin-svelte/releases/tag/%40sveltejs/vite-plugin-svelte%407.0.0)
- The deprecated option in svelte.config.js is removed; use compilerOptions.hmr instead. (7.0.0) — [release notes](https://github.com/sveltejs/vite-plugin-svelte/releases/tag/%40sveltejs/vite-plugin-svelte%407.0.0)
- The deprecated option in svelte.config.js is removed because it is no longer needed. (7.0.0) — [release notes](https://github.com/sveltejs/vite-plugin-svelte/releases/tag/%40sveltejs/vite-plugin-svelte%407.0.0)

### New APIs and options

- dynamicCompileOptions now receives the environment, allowing its compile options to depend on it. (7.3.0) — [release notes](https://github.com/sveltejs/vite-plugin-svelte/releases/tag/%40sveltejs/vite-plugin-svelte%407.3.0)

### Behavior and default changes

- The optimizer is enabled for server environments during development. (7.1.0) — [release notes](https://github.com/sveltejs/vite-plugin-svelte/releases/tag/%40sveltejs/vite-plugin-svelte%407.1.0)
- The plugin no longer overrides compilerOptions.cssHash because Svelte now produces a stable CSS hash by itself. (7.0.0) — [release notes](https://github.com/sveltejs/vite-plugin-svelte/releases/tag/%40sveltejs/vite-plugin-svelte%407.0.0)

### Tooling

- The inspector adds a context menu showing the current component stack. (7.2.0) — [release notes](https://github.com/sveltejs/vite-plugin-svelte/releases/tag/%40sveltejs/vite-plugin-svelte%407.2.0)

### Fixes and other changes

- Fixes inspector injection into the client under Vite+ on pnpm, where the realpathed client module has no vite/ segment before dist/. (7.3.1) — [release notes](https://github.com/sveltejs/vite-plugin-svelte/releases/tag/%40sveltejs/vite-plugin-svelte%407.3.1)
- Inline config is no longer logged when unexpected options are encountered. (7.3.0) — [release notes](https://github.com/sveltejs/vite-plugin-svelte/releases/tag/%40sveltejs/vite-plugin-svelte%407.3.0)
- Enforces left-to-right styles for the inspector. (7.1.4) — [release notes](https://github.com/sveltejs/vite-plugin-svelte/releases/tag/%40sveltejs/vite-plugin-svelte%407.1.4)
- Ensures the inspector is injected into the client correctly for Vite+ projects. (7.1.3) — [release notes](https://github.com/sveltejs/vite-plugin-svelte/releases/tag/%40sveltejs/vite-plugin-svelte%407.1.3)
- Correctly resolves compiled CSS on the server for dependencies with Svelte files. (7.1.1) — [release notes](https://github.com/sveltejs/vite-plugin-svelte/releases/tag/%40sveltejs/vite-plugin-svelte%407.1.2), [release notes](https://github.com/sveltejs/vite-plugin-svelte/releases/tag/%40sveltejs/vite-plugin-svelte%407.1.1)
- vitePreprocess now passes this TypeScript option to transformWithOxc, preventing value imports from being dropped when referenced only in Svelte template markup. (7.1.1) — [release notes](https://github.com/sveltejs/vite-plugin-svelte/releases/tag/%40sveltejs/vite-plugin-svelte%407.1.1)

## @sveltejs/vite-plugin-svelte 6

### Tooling

- Updates experimental support for rolldown-vite to Vite 8 beta, so developers can use the plugin with that beta. (6.2.2) — [release notes](https://github.com/sveltejs/vite-plugin-svelte/releases/tag/%40sveltejs/vite-plugin-svelte%406.2.2)

### Fixes and other changes

- Svelte files are recompiled and CSS modules are returned correctly when updates are reported out of order. (6.2.4) — [release notes](https://github.com/sveltejs/vite-plugin-svelte/releases/tag/%40sveltejs/vite-plugin-svelte%406.2.4)
- The filter ignores zero-tagged ids according to Rollup convention. (6.2.3) — [release notes](https://github.com/sveltejs/vite-plugin-svelte/releases/tag/%40sveltejs/vite-plugin-svelte%406.2.3)
