- 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.0
in 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: false
is 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.useVitePreprocess
option 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 thesvelte
field 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.prebundleSvelteLibraries
option (#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.dynamicCompileOptions
for 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
experimental
section to options and moveuseVitePreprocess
there (#99)Experimental options are not ready for production use and breaking changes to them can occur in any release
If you already had
useVitePreprocess
enabled, 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.generateMissingPreprocessorSourcemaps
to use it
-
removed redundant
disableCssHmr
option (#99)You can use
emitCss: false
oremitCss: !!isProduction
instead
- 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: false
for 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