- fix: inject the inspector into the client under Vite+ on pnpm, where the realpathed client module has no
vite/segment beforedist/(#1373)
- feat: pass environment to
dynamicCompileOptions(#1386)
- fix: don't log inline config when encountering unexpected options (#1376)
- feat(inspector): add a context menu with current component stack (#1370)
- fix: enforce ltr styles for inspector (#1324)
- fix: ensure the inspector is injected into the client correctly for Vite+ projects (#1355)
- fix: correctly resolve compiled CSS on the server for dependencies with Svelte files (#1342)
-
fix: pass
typescript.onlyRemoveTypeImportstotransformWithOxcinvitePreprocessso that value imports are not dropped when they are only referenced in Svelte template markup (#1326) -
fix: correctly resolve compiled CSS for optimised Svelte dependencies on the server (#1336)
- feat: enable optimizer for server environments during dev (#1328)
-
breaking(deps): require vite 8 (#1266)
-
breaking(options): remove deprecated options (#1274)
vitePlugin.hotinsvelte.config.jsusecompilerOptions.hmrinsteadvitePlugin.ignorePluginPreprocessorsinsvelte.config.jsno longer neededapi.idFilterofvite-plugin-svelte:apiuseapi.filterinsteadplugin.api.sveltePreprocessof other vite plugins Update affected plugins to a newer version or remove them. See docs for more information.
-
breaking(dev): no longer overrides compilerOptions.cssHash because Svelte now produces a stable css hash by itself (#1271)
-
breaking(inspector): integrate vite-plugin-svelte-inspector into vite-plugin-svelte to avoid circular dependency (#1270)
-
breaking(deps): require svelte 5.46.4 or later (#1271)
-
chore: upgrade vitefu to compatible peer dependency range (#1286)
-
remove author field from package.json (#1281)
-
chore: upgrade vitefu to compatible peer dependency range (#1286)
-
remove author field from package.json (#1281)
-
breaking(deps): require vite 8 (#1266)
-
breaking(deps): require svelte 5.46.4 or later (#1271)
-
breaking(options): remove deprecated options (#1274)
vitePlugin.hotinsvelte.config.jsusecompilerOptions.hmrinsteadvitePlugin.ignorePluginPreprocessorsinsvelte.config.jsno longer neededapi.idFilterofvite-plugin-svelte:apiuseapi.filterinsteadplugin.api.sveltePreprocessof other vite plugins Update affected plugins to a newer version or remove them. See docs for more information.
-
breaking(dev): no longer overrides compilerOptions.cssHash because Svelte now produces a stable css hash by itself (#1271)
-
breaking(inspector): integrate vite-plugin-svelte-inspector into vite-plugin-svelte to avoid circular dependency (#1270)
- fix(hmr): ensure that svelte files are recompiled and updated css modules returned correctly when reported out of order (#1258)
- fix(filter): ignore zero-tagged ids per rollup convention (#1255)
-
Update experimental support for rolldown-vite to vite 8 beta (#1246)
-
perf: switch from debug to obug (smaller, esm-only) (#1241)
-
fix: remove unscopable global styles warning (#1223)
-
Remove automatic configuration for rolldownOptions.optimization.inlineConst because latest version of rolldown-vite has it enabled by default. (#1225)
- feat(rolldown-vite): enable
optimization.inlineConstby default to ensure treeshaking works with esm-env in svelte (#1207)
-
fix: allow preprocess plugin to run twice (#1206)
-
fix(types): update urls to PreprocessorGroup and CompileOptions in type documention (#1203)
-
replace kleur dependency with builtin node:utils styleText (#1210)
- fix(api): add
api.filterand deprecateapi.idFilterto avoid confusingfilter.id = idFilter.idassignments when used as hybrid filter in other plugins (#1199)
- fix: ensure compiled css is returned when reloading during dev with ssr (e.g. SvelteKit) (#1194)
- fix: ensure compiled svelte css is loaded correctly when rebuilding in
build --watch(#1189)
- feat: add support for the new experimental.async option and apply dynamicCompileOptions when compiling Svelte modules (#1176)
-
skip comment blocks when reporting compiler errors that might be caused by a preprocessor issue (#1166)
-
increase logLevel to info for "no Svelte config found" message (#1179)
-
drop support for node18 and update exports map to use default export. cjs is supported via require esm in node 20.19+ (#1129)
-
Remove experimental "advanced raw queries" feature. Basic
File.svelte?rawis still supported. (#1145) -
Using the typescript preprocessor now requires a tsconfig.json with verbatimModuleSyntax enabled, eg @tsconfig/svelte (#1135)
-
remove support for loading commonjs svelte config files (#1142)
-
bump vite peer dependency to ^6.3.0 || ^7.0.0 (#1130)
-
define filters using object hook syntax and optimize the filter for resolveId (#1132)
NOTE include logic has changed to files matching
svelteConfig.includeORsvelteConfig.extensions. Previously only files matching both were loaded and transformed. -
split preprocess and compile into separate plugins (#1145)
It allows vite plugins to transform code between preprocess and compile, see docs and is the recommended way to replace
plugin.api.sveltePreprocessusage in other vite plugins. You can also use vite-plugin-inspect now to inspect the result of svelte.preprocess by checking the transform ofvite-plugin-svelte:preprocessNOTE This can be a breaking change in case you have other plugins besides vite-plugin-svelte transforming your svelte code To fix this, read the docs on how to order plugins in relation to preprocess and compile
-
Add experimental support for rolldown-vite (#1135)
-
replace esbuild optimizer with rolldown optimizer if rolldown-vite is used (#1135)
-
add support for loading TypeScript Svelte config files in runtimes that support it (#1142)
NOTE This change only applies to vite-plugin-svelte.
To use
svelte.config.tsin SvelteKit, with the Svelte VS Code extension or other tools reading the Svelte config file, you have to wait until support is implemented there.
-
reduce deprecation logging to info and allow disabling it with a flag (#1158)
-
refactor internal caching to reduce code, memory use and avoid perEnvironmentCache (#1154)
-
fix: crawl local workspace private packages devDependencies for generating vite config ssr.noExternal (#1155)
-
log known-issues link when using rolldown-vite (#1144)
-
use vite environment api internally (#1145)
-
remove vite7 beta releases from peerDependency range. (#1151)
-
deprecate
plugin.api.sveltePreprocess(#1145)
-
reduce deprecation logging to info and allow disabling it with a flag (#1158)
-
refactor internal caching to reduce code, memory use and avoid perEnvironmentCache (#1154)
-
fix: crawl local workspace private packages devDependencies for generating vite config ssr.noExternal (#1155)
-
Remove experimental "advanced raw queries" feature. Basic
File.svelte?rawis still supported. (#1145) -
split preprocess and compile into separate plugins (#1145)
-
use vite environment api internally (#1145)
-
remove vite7 beta releases from peerDependency range. (#1151)
-
deprecate
plugin.api.sveltePreprocess(#1145)
- remove support for loading commonjs svelte config files (#1142)
-
add support for loading TypeScript Svelte config files in runtimes that support it (#1142)
NOTE This change only applies to vite-plugin-svelte.
To use
svelte.config.tsin SvelteKit, with the Svelte VS Code extension or other tools reading the Svelte config file, you have to wait until support is implemented there.
- log known-issues link when using rolldown-vite (#1144)
-
drop support for node18 and update exports map to use default export. cjs is supported via require esm in node 20.19+ (#1129)
-
Using the typescript preprocessor now requires a tsconfig.json with verbatimModuleSyntax enabled, eg @tsconfig/svelte (#1135)
-
bump vite peer dependency to ^6.3.0 || ^7.0.0 (#1130)
-
define filters using object hook syntax and optimize the filter for resolveId (#1132)
[!NOTE] include logic has changed to files matching
svelteConfig.includeORsvelteConfig.extensions. Previously only files matching both were loaded and transformed.
-
Add experimental support for rolldown-vite (#1135)
-
replace esbuild optimizer with rolldown optimizer if rolldown-vite is used (#1135)
- Updated dependencies [
63d1fc6,59e082e]:- @sveltejs/[email protected]
- scope css to js module to enable treeshaking scoped css from unused components. Requires vite 6.2 and svelte 5.26 (#1092)
- add
svelte > clsxto optimizeDeps.include to avoid page reload when using vite6 and npm (#1124)
- fix errorhandling to work with errors that don't have a code property (#1054)
- adapt internal handling of warning and error
codeproperty to changes in svelte5 (#1044)
- Fix peer dependencies warning (#1038)
-
Add
esm-envtossr.noExternalby default to resolve its conditions with Vite (#1020) -
Support
?inlinequery on Svelte style virtual modules (#1024)
-
remove vite6 beta from peer range (#1035)
-
Allow script tags to span multiple lines (
0db95a9) -
Updated dependencies [
4fefbc2,e262266]:- @sveltejs/[email protected]
-
Add
esm-envtossr.noExternalby default to resolve its conditions with Vite (#1020) -
Support
?inlinequery on Svelte style virtual modules (#1024)
-
Allow script tags to span multiple lines (
0db95a9) -
Updated dependencies [
e262266]:- @sveltejs/[email protected]
- removed references to compiler options no longer available in svelte5 (#1010)
-
only prebundle files with default filenames (.svelte for components, .svelte.(js|ts) for modules) (#901)
-
remove support for Svelte 4 (#892)
-
breaking(types): some types that have been unintentionally public are now private (#934)
-
disable script preprocessing in vitePreprocess() by default because Svelte 5 supports lang=ts out of the box (#892)
-
replaced svelte-hmr with Svelte 5 compiler hmr integration (#892)
-
allow infix notation for svelte modules (#901)
Previously, only suffix notation
.svelte.jswas allowed, now you can also use.svelte.test.jsor.svelte.stories.js. This helps when writing testcases or other auxillary code where you may want to use runes too. -
feat(config): dynamically extract list of svelte exports from peer dependency so that new exports work automatically" (#941)
-
feat(warnings): change default loglevel of warnings originating from files in node_modules to debug. To see them call
DEBUG:vite-plugin-svelte:node-modules-onwarn pnpm build. (#989)
-
fix: make defaultHandler a required argument for onwarn in plugin options (#895)
-
prebundle with dev: true by default (#901)
-
fix(dev): compile with hmr: false for prebundled deps as hmr does not work with that (#950)
-
fix: ensure svelte modules correctly run in DEV mode (#906)
-
ensure consistent use of compileOptions.hmr also for prebundling (#956)
-
fix(optimizeDeps): avoid to optimise server only entrypoints of svelte that are never used on the client (#941)
-
update peer on workspace packages to avoid packages bumping each other (#916)
-
export PluginOptions interface (#976)
-
Remove log about experimental status of Svelte 5. Note that breaking changes can still occur while vite-plugin-svelte 4 is in prerelease mode (#894)
-
fix: ensure vite config is only resolved once during lazy init of vitePreprocess (#912)
-
fix(vitePreprocess): default to build config so that svelte-check does not trigger dev-only plugins (#931)
-
fix: only apply infix filter to basename (#920)
-
fix: disable hmr when vite config server.hmr is false (#913)
-
fix(dev): make sure custom cssHash is applied consistently even for prebundled components to avoid hash mismatches during hydration (#950)
-
Updated dependencies [
22baa25,49324db,e9f048c,213fedd]:- @sveltejs/[email protected]
- feat(warnings): change default loglevel of warnings originating from files in node_modules to debug. To see them call
DEBUG:vite-plugin-svelte:node-modules-onwarn pnpm build. (#989)
- export PluginOptions interface (#976)
- ensure consistent use of compileOptions.hmr also for prebundling (#956)
-
fix(dev): compile with hmr: false for prebundled deps as hmr does not work with that (#950)
-
fix(dev): make sure custom cssHash is applied consistently even for prebundled components to avoid hash mismatches during hydration (#950)
- breaking(types): some types that have been unintentionally public are now private (#934)
- feat(config): dynamically extract list of svelte exports from peer dependency so that new exports work automatically" (#941)
-
fix(optimizeDeps): avoid to optimise server only entrypoints of svelte that are never used on the client (#941)
-
fix(vitePreprocess): default to build config so that svelte-check does not trigger dev-only plugins (#931)
-
Updated dependencies [
e9f048c362a0769b3d5afa87da6f8398f46fe1a9]:- @sveltejs/[email protected]
- fix: only apply infix filter to basename (#920)
-
update peer on workspace packages to avoid packages bumping each other (#916)
-
fix: ensure vite config is only resolved once during lazy init of vitePreprocess (#912)
-
fix: disable hmr when vite config server.hmr is false (#913)
- only prebundle files with default filenames (.svelte for components, .svelte.(js|ts) for modules) (#901)
-
allow infix notation for svelte modules (#901)
Previously, only suffix notation
.svelte.jswas allowed, now you can also use.svelte.test.jsor.svelte.stories.js. This helps when writing testcases or other auxillary code where you may want to use runes too.
-
prebundle with dev: true by default (#901)
-
fix: ensure svelte modules correctly run in DEV mode (#906)
-
Updated dependencies []:
- @sveltejs/[email protected]
-
remove support for Svelte 4 (#892)
-
disable script preprocessing in vitePreprocess() by default because Svelte 5 supports lang=ts out of the box (#892)
-
replaced svelte-hmr with Svelte 5 compiler hmr integration (#892)
-
fix: make defaultHandler a required argument for onwarn in plugin options (#895)
-
Remove log about experimental status of Svelte 5. Note that breaking changes can still occur while vite-plugin-svelte 4 is in prerelease mode (#894)
-
Updated dependencies [
49324dbf747a46ae75b405a29fc7feac2db966dd]:- @sveltejs/[email protected]
- feat(svelte5): enable hmr option in dev (#836)
-
Remove unnecessary
enableSourcemapoption usage and prevent passing it in Svelte 5 (#862) -
Updated dependencies [
8ae3dc8cf415355f406f23d6104cb6153d75dfc8]:- @sveltejs/[email protected]
- fix(compile): correctly determine script lang in files where a comment precedes the script tag (#844)
-
fix: improve checking of script and style in .svelte code to work with new generic= attribute (#799)
-
Fix optional parameter types (#797)
-
Update log level for HMR updates where the output is functionally equivalent to the previous version to "debug" (#806)
-
breaking: update minimum supported node version to node18 (#744)
-
breaking: update supported vite version to vite 5 (#743)
-
breaking: remove support for svelte 3 (#746)
-
Preprocess style tags by default with vitePreprocess (#756)
-
breaking: remove package.json export (#751)
-
breaking(types): emit types with dts-buddy to include type map (#751)
-
breaking(debug): remove 'vite:' and add suffixes to debug namespace (#749)
-
breaking(types): rename SvelteOptions to SvelteConfig (#751)
-
breaking: prefer svelte exports condition over package.json svelte field (#747)
-
feat(preprocess): add warnings in case preprocess dependencies contain anomalies (#767)
-
Add experimental support for svelte5 (#787)
-
fix(types): use correct type Options for svelte function arg (#751)
-
Improve compile error messages (#757)
-
feat(compile): promote experimental.dynamicCompileOptions to stable (#765)
-
update peer dependencies to use final releases (#794)
-
Updated dependencies [
d5b952f,bd5d43e,10ec2a4,62afd80,1be1c08]:- @sveltejs/[email protected]
- Add experimental support for svelte5 (#787)
-
breaking: remove package.json export (#751)
-
breaking(types): emit types with dts-buddy to include type map (#751)
-
breaking(types): rename SvelteOptions to SvelteConfig (#751)
-
fix(types): use correct type Options for svelte function arg (#751)
-
Updated dependencies [
62afd80]:- @sveltejs/[email protected]
- Preprocess style tags by default with vitePreprocess (#756)
- feat(preprocess): add warnings in case preprocess dependencies contain anomalies (#767)
-
Improve compile error messages (#757)
-
feat(compile): promote experimental.dynamicCompileOptions to stable (#765)
-
breaking: update minimum supported node version to node18 (#744)
-
breaking: update supported vite version to vite 5 (#743)
-
breaking: remove support for svelte 3 (#746)
-
breaking(debug): remove 'vite:' and add suffixes to debug namespace (#749)
-
breaking: prefer svelte exports condition over package.json svelte field (#747)
- Updated dependencies [
d5b952f,bd5d43e,10ec2a4]:- @sveltejs/[email protected]
- fix(prebundleSvelteLibraries): don't try to append missing sourcemap (#737)
- fix(config): ignore @sveltejs/package and svelte2tsx for optimizeDeps.include and ssr.noExternal generated config (#711)
- fix links in error handling (console and vite overlay) (#700)
- add svelte/internal/disclose-version to vite config optimizeDeps.include by default (#692)
-
fix: remove pure comments only for Svelte 3 (#673)
-
Bump supported Svelte 4 version to
^4.0.0(#675) -
Updated dependencies [
ffbe8d3]:- @sveltejs/[email protected]
-
Ensure compatibility with Svelte 4 prereleases (#661)
Note: We are going to remove
-nextfrom the Svelte peerDependency range in a minor release once Svelte4.0.0final has been released. -
Updated dependencies [
f5d9bd2]:- @sveltejs/[email protected]
- refactor: release vite-plugin-svelte as unbundled javascript with jsdoc types (#657)
- Refactor Svelte inspector as a separate package (#646)
-
remove unused invalid property Code.dependencies on compiler ouput type (#652)
-
fix(build): watch preprocessor dependencies during build --watch (#653)
-
Updated dependencies [
1dd6933]:- @sveltejs/[email protected]
-
feat(inspector): Promote experimental.inspector to regular option (#631)
-
feat(inspector): allow configuration via environment SVELTE_INSPECTOR_OPTIONS or SVELTE_INSPECTOR_TOGGLE (#631)
-
feat(inspector): enable holdMode by default (#631)
-
Remove internal SvelteKit specific handling (#638)
-
fix(inspector): prepend vite base when calling __openInEditor (#631)
-
fix(inspector): after a file has been opened, automatically disable inspector on leaving browser (#631)
-
fix(inspector): use control-shift as default keycombo on linux to avoid problems in firefox (#631)
-
fix(svelte-inspector): mount outside body to avoid hydration claiming body removing it (#631)
- fix(resolve): normalize path resolved from "svelte" field to ensure consistency across operating systems (#635)
- log warnings for packages that use the
sveltefield to resolve Svelte files differently than standard Vite resolve (#510)
-
fix(vitePreprocess): add dependencies to style preprocessor output (#625)
-
Skip Vite resolve workaround on Vite 4.1+ or Svelte 4+ (#622)
-
fix(vitePreprocess): use relative paths without lang suffix in sourcemaps to avoid missing source file errors. (#625)
-
Log stats in debug mode and remove
experimental.disableCompileStatsoption. UseDEBUG="vite:vite-plugin-svelte:stats"when starting the dev server or build to log the compile stats. (#614)
- fix(vitePreprocess): remove problematic pure annotations that could lead to wrong build output in some cases (#609)
-
fix(vitePreprocess): use relative paths in sourcemap sources (#570)
-
show correct error overlay for compiler errors during hot update (#592)
-
respect custom resolve.mainFields config when adding svelte (#582)
- improve detection of sveltekit in inspector plugin to be compatible to latest changes (
47c54c9)
- update minimum version of vitefu dependency to avoid peer mismatch (#543)
-
update svelte peerDependency to ^3.54.0 (#529)
-
remove commonjs variant of vite-plugin-svelte (#522)
Make sure your package.json contains
"type": "module"and see FAQ for more information -
update vite peerDependency to vite-4 (#521)
-
Remove
experimental.useVitePreprocessoption in favour ofvitePreprocess(#538) -
Remove pre Vite 3.2 support for
vitePreprocess(#536)
-
Remove
experimental.useVitePreprocessoption in favour ofvitePreprocess(#538) -
Remove pre Vite 3.2 support for
vitePreprocess(#536)
- reintroduce custom svelte/ssr resolve (#532)
-
remove custom svelte/ssr resolve that is no longer needed in vite 4 (#527)
-
update svelte peerDependency to ^3.54.0 (#529)
-
support
&directand&rawquery parameters for svelte requests (#513) -
Export
vitePreprocess()Svelte preprocessor (#509)
-
ensure sources paths in sourcemaps are not absolute file paths (#513)
-
remove experimental.generateMissingPreprocessorSourcemaps (#514)
- improve robustness of compile stats taking (#507)
-
enable
prebundleSvelteLibrariesduring dev by default to improve page loading for the dev server. (#494)see the FAQ for more information about
prebundleSvelteLibrariesand how to tune it. -
Enable resolving via "svelte" exports condition (#502)
-
add compile time stats logging (#503)
- support string values of compilerOptions.css added in svelte 3.53.0 (#490)
-
simplify init of compilerOptions.hydratable for kit (kit.browser.hydrate is no longer in use) (#496)
-
when prebundleSvelteLibraries is true and a dependency is manually excluded, generate reincludes for it's cjs deps (#493)
-
Refactor Svelte libraries config handling (#478)
-
fix(prebundleSvelteLibraries): avoid resolving via svelte field after a library has been prebundled (#482)
-
Use
preprocessCSSAPI from Vite 3.2 foruseVitePreprocessoption (#479) -
add types to exports map in package.json (#488)
- Bring
prebundleSvelteLibrariesout of experimental, it is now a top-level option (#476)
- Remove
@rollup/pluginutilsdependency (#469)
- Use esnext for useVitePreprocess (#452)
-
svelte-inspector: select hovered element instead of parent on mousemouse (#449)
-
svelte-inspector: ignore navigation keys while not enabled (#449)
- svelte-inspector: prevent info-bubble select (#445)
-
update svelte-hmr and enable partial hmr accept by default (fixes #134) (#440)
-
svelte-inspector: add keyboard navigation, select element on activation, improve a11y and info bubble position/content (#438)
- removed peerDependency for vite 3.1.0-beta as vite 3.1.0 final has been released (#431)
-
temporarily add vite 3.1 beta to peer dependencies rule to avoid warning on kit projects using it (#427)
warning: this is going to be changed back to
^3.0.0in a future patch
- ignore keyup events without key in inspector (#417)
- fix svelte-inspector import for vite 3.1 (#423)
- update svelte-inspector inject code to be compatible with @sveltejs/kit > 1.0.0-next.405 (#411)
- update to vite3 (#359)
- bump minimum required node version to 14.18.0 to align with vite 3 (#359)
-
move plugin options in svelte.config.js into "vitePlugin" (#389)
update your svelte.config.js and wrap plugin options with
vitePlugin// svelte.config.js compilerOptions: {...}, preprocess: {...}, extensions: [...], onwarn: () => {...}, kit: {}, + vitePlugin: { // include, exclude, emitCss, hot, ignorePluginPreprocessors, disableDependencyReinclusion, experimental + }
- Always add dependencies using svelte to ssr.noExternal in vite config (#359)
- New experimental option sendWarningsToBrowser (#372)
- fix hmr not updating a component when returning to the last working state from an error state (#371)
- Automate setting of compilerOptions.hydratable from kit.browser.hydrate option (#368)
- Do not try to resolve svelte field in __vite-browser-external, see (#362)" (#363)
- Use last modified time as cache busting parameter (#356)
- Export loadSvelteConfig (#356)
- Bump svelte-hmr version (#349)
- Handle inspector autocomplete keydown event (#338)
- Remove user-specified values for essential compilerOptions generate, format, cssHash and filename and log a warning (#346)
- Add experimental Svelte Inspector to quickly jump to code from your browser. (#322)
- use deepmerge utility to merge inline config and svelte.config.js (#322)
- do not warn if kit options are passed as inline config (#319)
- Support import typescript files with .js extension (#324)
- do not restart vite devserver on changes of svelte config when
configFile: falseis set (#319)
- skip reading default svelte config file with inline option
configFile: false(#317)
- Update vite peerDependency to ^2.9.0 and handle edge cases for
experimental.prebundleSvelteLibraries(#294)
- Improved CSS Source Maps when using vite's
css: { devSourcemap: true }(#305)
- improve handling of transitive cjs dependencies of svelte libraries during dev ssr (#289)
- don't warn if dependency doesn't export package.json (#272)
- Optimize nested index-only dependencies (#282)
- Remove transforming svelte css (#280)
- don't try to resolve node internal modules via package.json svelte field (#266)
- include stack and filename in error reporting for svelte preprocess errors (#260)
- do not use require-relative to resolve svelte field of libraries and cache resolved values (fixes #244) (#254)
- Automatically re-prebundle when Svelte config changed for
experimental.prebundleSvelteLibraries(#245)
- use the resolved vite root to support backend integrations (#247)
- fix
experimental.useVitePreprocessoption for Vite 2.8 (#240)
- auto-restart SvelteKit when Svelte config changed (#237)
- handle preprocess for prebundleSvelteLibraries (#229)
- Skip prebundle non-js nested dependencies (#234)
- handle production builds for non "production" mode (#229)
- update vite peerDependency to ^2.7.0 and refactor server restart on change of svelte.config.js (#223)
- Ignore import protocols like
node:when resolving thesveltefield in package.json (#225)
- Improved error reporting for svelte compiler errors (#220)
- Bump svelte peer dependency to ^3.44.0 (#202)
- drop support for node12 (#198)
- Add
experimental.prebundleSvelteLibrariesoption (#200)
- Disable CSS sourcemap in SSR (#201)
- Fix emitCss behaviour in a svelte config (#194)
- Run Vite preprocessors first in markup phase (#189)
- Handle flexible ssr signature for hooks with ssr argument (#187)
- minimum required version of vite is 2.6.0 (#182)
- Use transformWithEsbuild for vite script preprocessor (#173)
- Only add all Svelte dependencies to ssr.noExternal in SSR build (#169)
- Svelte libraries without any Svelte components are also added to ssr.noExternal (#166)
- Only optimize nested cjs dependencies (#163)
- Add option disableDependencyReinclusion to offer users a way out of automatic optimization for hybrid packages (#161)
- Improve automatic dependency pre-bundling by not reincluding dependencies that are already present in optimizeDeps.exclude (#159)
-
Enable optimization for nested dependencies of excluded svelte dependencies (#157)
Vite 2.5.3 and above is needed to support this feature.
- add automatically excluded svelte dependencies to ssr.noExternal (#147)
- automatically exclude svelte dependencies in vite.optimizeDeps (#145)
-
automatically include svelte in vite config optimizeDeps.include (#137)
Previously, svelte was automatically excluded. We include it now by default to improve deduplication.
As a result, svelte is pre-bundled by vite during dev, which it logs when starting the devserver
Pre-bundling dependencies: svelte/animate svelte/easing svelte/internal svelte/motion svelte/store (...and 2 more) (this will be run only when your dependencies or config have changed)
And it's also visible in the browsers network tab, where requests for svelte imports now start with
node_modules/.vite/during dev.Check out the vite pre-bundling documentation for more information.
To get the old behavior back, add the following to your vite config
optimizeDeps: { exclude: ["svelte"]; }
- prepare for a change in vite 2.5.0 that would lead to errors in preprocessor dependency handling (fixes #130) (#131)
-
change default value of compilerOptions.hydratable to false (#122)
This is done to align with svelte compiler defaults and improve output in non-ssr scenarios.
Add
{compilerOptions: {hydratable: true}}to vite-plugin-svelte config if you need hydration (eg. for ssr)
- add config option
experimental.dynamicCompileOptionsfor finegrained control over compileOptions (#122)
- replace querystring with URLSearchParams (#107)
- import svelte types instead of duplicating them (#105)
- update svelte-hmr to 0.14.7 to fix issue with svelte 3.40 (#112)
- turn diff-match-patch into an optional peer dependency to reduce footprint (#110)
-
Add
experimentalsection to options and moveuseVitePreprocessthere (#99)Experimental options are not ready for production use and breaking changes to them can occur in any release
If you already had
useVitePreprocessenabled, update you config:- svelte({useVitePreprocess: true}) + svelte({experimental: {useVitePreprocess: true}})
-
Add option to ignore svelte preprocessors of other vite plugins (#98)
- ignore them all:
ignorePluginPreprocessors: true - ignore by name:
ignorePluginPreprocessors: ['<name of plugin>',...]
- ignore them all:
-
Move plugin preprocessor definition to api namespace (#98)
Plugins that provide
myplugin.sveltePreprocess, should move it tomyplugin.api.sveltePreprocess, as suggested by rollup
-
Experimental: Generate sourcemaps for preprocessors that lack them (#101)
enable option
experimental.generateMissingPreprocessorSourcemapsto use it
-
removed redundant
disableCssHmroption (#99)You can use
emitCss: falseoremitCss: !!isProductioninstead
- reduce log output with log.once function to filter repetetive messages (#101)
-
Resolve svelte to svelte/ssr when building for ssr (fixes #74) (#75) (
f6f56fe) -
Restart dev server when svelte config file changes (#72) (
5100376) -
Allow svelte imports to be added to optimizeDeps.include and don't exclude svelte from optimizeDeps then (#68) (
9583900) -
Vite config can be updated based on values in svelte config (see #60) (#64) (
c3f65fd)
-
do not transform imports tagged with ?url or ?raw (fixes #87) (#88) (
d1d2638) -
update svelte-hmr to ^0.14.5 to fix hmr reordering issue introduced by a change in svelte 3.38.3 (#92) (
cdfd821) -
Refactored e2e-tests to use package.json scripts
-
Updated dependencies
-
convert to es module with cjs fallback, use named export instead of default (#54) (
0f7e256)If you are using vite-plugin-svelte with require, you should switch to esm and import the named export "svelte". An example can be found in the usage section of the readme
For existing esm configs update your import to use the new named export.
- import svelte from '@sveltejs/vite-plugin-svelte'; + import { svelte } from '@sveltejs/vite-plugin-svelte';
continuing with cjs/require is discouraged but if you must use it, update your require statement to use the named export
- const svelte = require('@sveltejs/vite-plugin-svelte'); + const { svelte } = require('@sveltejs/vite-plugin-svelte');
- Allow
emitCss: falsefor production builds and customizable compilerOptions.css and hydratable (fixes #9) (#41) (cb7f03d)
- 1be46f1: improved css hmr
- a0f5a65: Allow other vite plugins to define preprocessors
- 8d9ef96: fix: do not preserve types unless useVitePreprocess option is true
- 6f4a253: disable svelte-hmr overlay by default
- 18647aa: improve virtual css module path (fixes #14)
- 61439ae: initial release