chore(deps): update dependency vite to v5 - autoclosed
This MR contains the following updates:
Package | Type | Update | Change |
---|---|---|---|
vite (source) | devDependencies | major | ^4.0.0 -> ^5.0.0 |
Release Notes
vitejs/vite (vite)
v5.4.11
Please refer to CHANGELOG.md for details.
v5.4.10
Please refer to CHANGELOG.md for details.
v5.4.9
Please refer to CHANGELOG.md for details.
v5.4.8
Please refer to CHANGELOG.md for details.
v5.4.7
Please refer to CHANGELOG.md for details.
v5.4.6
Please refer to CHANGELOG.md for details.
v5.4.5
Please refer to CHANGELOG.md for details.
v5.4.4
Please refer to CHANGELOG.md for details.
v5.4.3
- fix: allow getting URL of JS files in publicDir (#17915) (943ece1), closes #17915
- fix: cjs warning respect the logLevel flag (#17993) (dc3c14f), closes #17993
- fix: improve CJS warning trace information (#17926) (5c5f82c), closes #17926
- fix: only remove entry assets handled by Vite core (#17916) (ebfaa7e), closes #17916
- fix: waitForRequestIdle locked (#17982) (ad13760), closes #17982
- fix(css): fix directory index import in sass modern api (#17960) (9b001ba), closes #17960
- fix(css): fix sass
file://
reference (#17909) (561b940), closes #17909 - fix(css): fix sass modern source map (#17938) (d428e7e), closes #17938
- fix(deps): bump tsconfck (#17990) (8c661b2), closes #17990
- fix(html): rewrite assets url in
<template>
(#17988) (413c86a), closes #17988 - fix(preload): add crossorigin attribute in CSS link tags (#17930) (15871c7), closes #17930
- chore: reduce diffs with v6 branch (#17942) (bf9065a), closes #17942
- chore(deps): update all non-major dependencies (#17945) (cfb621e), closes #17945
- chore(deps): update all non-major dependencies (#17991) (0ca53cf), closes #17991
v5.4.2
- chore: remove stale TODOs (#17866) (e012f29), closes #17866
- refactor: remove redundant prepend/strip base (#17887) (3b8f03d), closes #17887
- fix: resolve relative URL generated by
renderBuiltUrl
passed to module preload (#16084) (fac3a8e), closes #16084 - feat: support originalFilename (#17867) (7d8c0e2), closes #17867
v5.4.1
- fix:
build.modulePreload.resolveDependencies
is optimizable (#16083) (e961b31), closes #16083 - fix: align CorsOptions.origin type with @types/cors (#17836) (1bda847), closes #17836
- fix: typings for vite:preloadError (#17868) (6700594), closes #17868
- fix(build): avoid re-define
__vite_import_meta_env__
(#17876) (e686d74), closes #17876 - fix(deps): update all non-major dependencies (#17869) (d11711c), closes #17869
- fix(lightningcss): search for assets with correct base path (#17856) (4e5ce3c), closes #17856
- fix(worker): handle self reference url worker in dependency for build (#17846) (391bb49), closes #17846
- chore: fix picocolors import for local dev (#17884) (9018255), closes #17884
- refactor: remove
handleHotUpdate
from watch-package-data plugin (#17865) (e16bf1f), closes #17865
v5.4.0
- fix(build): windows platform build output path error (#17818) (6ae0615), closes #17818
- fix(deps): update launch-editor to consume fix for windows paths (#17828) (cf2f90d), closes #17828
- fix(ssr): fix
global
variable name conflict (#17809) (6aa2206), closes #17809 - fix(worker): fix
importScripts
injection breaking iife code (#17827) (bb4ba9f), closes #17827 - chore: bump typescript-eslint to v8 (#17624) (d1891fd), closes #17624
- chore(deps): update all non-major dependencies (#17820) (bb2f8bb), closes #17820
- perf(ssr): do a single-pass over AST with node cache arrays (#17812) (81327eb), closes #17812
v5.3.6
Please refer to CHANGELOG.md for details.
v5.3.5
- refactor(asset): remove rollup 3 public file watch workaround (#16331) (66bdb1d), closes #16331
- fix: make
server
type less restrictive (fix #17627) (#17628) (b55c32f), closes #17627 #17628 - fix: show error if vite client cannot be loaded (#17419) (db5ab1d), closes #17419
- fix(build): env output is not stable (#17748) (b240a83), closes #17748
- fix(client): fix vite error path (#17744) (3c1bde3), closes #17744
- fix(css): resolve url aliases with fragments (fix: #17690) (#17691) (d906d3f)
- fix(deps): update all non-major dependencies (#17629) (93281b0), closes #17629
- fix(importMetaGlob): handle alias that starts with hash (#17743) (b58b423), closes #17743
- fix(ssrTransform): sourcemaps with multiple sources (#17677) (f321fa8), closes #17677
- chore: extend commit hash (#17709) (4fc9b64), closes #17709
- chore(deps): update all non-major dependencies (#17734) (9983731), closes #17734
- chore(deps): update typescript (#17699) (df5ceb3), closes #17699
- revert: fix(logger): truncate log over 5000 characters long (#16581) (#17729) (f4f488f), closes #16581 #17729
v5.3.4
- fix: update Terser type definitions (fix #17668) (#17669) (b723a75), closes #17668 #17669
- fix(build): skip preload treeshaking for nested braces (#17687) (4be96b4), closes #17687
- fix(css): include
.css?url
in assets field of manifest (#17623) (1465b20), closes #17623 - fix(worker): nested inlined worker always fallbacked to data URI worker instead of using blob worker (07bc489), closes #17509
- refactor: replace includes with logical operations (#17620) (c4a2227), closes #17620
- chore: add callback to http-proxy.d.ts jsdoc (#17646) (d8a5d70), closes #17646
v5.3.3
- fix: lazily evaluate __vite__mapDeps files (#17602) (dafff4a), closes #17602
- fix(deps): update all non-major dependencies (#17590) (012490c), closes #17590
- fix(lib): remove pure CSS dynamic import (#17601) (055f1c1), closes #17601
- fix(proxy): replace changeOrigin changes in 5.3.0 with new rewriteWsOrigin option (#17563) (14c3d49), closes #17563
v5.3.2
- fix(client): uniform variable
location
(#17528) (a8e2f6f), closes #17528 - fix(deps): update all non-major dependencies (#17494) (bf123f2), closes #17494
- fix(typescript): correctly expand ${configDir} in tsconfig.json (#17576) (24c799b), closes #17576
- chore: fix some comments (#17495) (ec16a5e), closes #17495
- chore(deps): update all non-major dependencies (#17553) (a33a97f), closes #17553
- chore(deps): update dependency eslint to v9 (#16661) (6c10662), closes #16661
- chore(deps): update es-module-lexer to 1.5.4 (#17555) (2d6672f), closes #17555
- refactor(optimizer): use early continues (#17551) (7c06ef0), closes #17551
v5.3.1
- fix(build): handle preload treeshaking for braces (#17479) (d355568), closes #17479
- fix(build): handle preload treeshaking for commas (#17472) (3e27071), closes #17472
- fix(build): preload treeshaking ignore equal (#17480) (6ced135), closes #17480
- chore: consolidate changelog for 5.3 (#17476) (1f09344), closes #17476
v5.3.0
Features
- feat: asset type add bmp (#17439) (ec287f8), closes #17439
- feat(typescript): update tsconfck to add support for
${configDir}
replacement in ts 5.5 (#17350) (4835e2b), closes #17350 - refactor(build): remove quotes from preload marker (#16562) (9853190), closes #16562
- feat: add 'system' library format (#11256) (4102ca9), closes #11256
- feat: add an option to not start a websocket server (#16219) (14b5ced), closes #16219
- feat: add headTagInsertCheck warning (#16555) (9f02a9f), closes #16555
- feat(asset): support
/*@​vite-ignore*/
fornew URL(, import.meta.url)
(#16590) (8880bc5), closes #16590 - chore(deps): update esbuild (#17290) (5f13bf8), closes #17290
Performance
- refactor: plugin container (#17288) (4aa4a80), closes #17288
- refactor: remove acorn (#16238) (454e2d1), closes #16238
Fixes
- fix: typo in client log (#17363) (68aa9f8), closes #17363
- fix(ssrTransform): handle arbitrary module namespace identifiers (#17446) (0a76652), closes #17446
- fix: gracefully shutdown preview server on
SIGTERM
(fix #12990) (#17333) (2207a68), closes #12990 #17333 - fix(css): ensure order of extracted CSS (#16588) (a52ed1d), closes #16588
- fix(deps): update all non-major dependencies (#17430) (4453d35), closes #17430
- fix(build): allow dynamic import treeshaking when injecting preload (#14221) (f43f71f), closes #14221
- fix(css): handle lightningcss minification in Deno (#17372) (b3f5bd1), closes #17372
- fix(css): handle url replacing when preprocessing with lightningcss (#17364) (6fbb5e0), closes #17364
- fix(ssr): remove pure CSS dynamic import (#17371) (67ff94b), closes #17371
- fix(ssr): resolve interlocking circular dependency issues (#15395) (687c38b), closes #15395
- fix: adjust import analysis behavior to match Node (#16738) (f599ab4), closes #16738
- fix: prevent unhandledRejection if
--open
fails (#16726) (1f60647), closes #16726 - fix(optimize-deps): don't externalize JS files imported with asset extensions (#16242) (4161843), closes #16242
- fix(proxy): rewrite the origin header to match the target for ws proxy (#16558) (7b0a65e), closes #16558
Chore
- test: disable isolate for unit test (#17448) (f16fae5), closes #17448
- build: use esbuild to speedup building vite package (#17299) (6db2515), closes #17299
- chore: add error recovery option to LightningCSSOptions (#17420) (e04193f), closes #17420
- chore(deps): update dependency @rollup/plugin-commonjs to v26 (#17431) (507b3de), closes #17431
- chore: add region comment (#17370) (a8c7083), closes #17370
- chore(deps): update all non-major dependencies (#17373) (f2d52f1), closes #17373
Previous Changelogs
5.3.0-beta.2 (2024-06-10)
5.3.0-beta.1 (2024-06-07)
5.3.0-beta.0 (2024-05-30)
v5.2.14
Please refer to CHANGELOG.md for details.
v5.2.13
Please refer to CHANGELOG.md for details.
v5.2.12
- chore: move to eslint flat config (#16743) (8f16765), closes #16743
- chore(deps): remove unused deps (#17329) (5a45745), closes #17329
- chore(deps): update all non-major dependencies (#16722) (b45922a), closes #16722
- fix: mention
build.rollupOptions.output.manualChunks
instead ofbuild.rollupOutput.manualChunks
(89378c0), closes #16721 - fix(build): make SystemJSWrapRE match lazy (#16633) (6583ad2), closes #16633
- fix(css): avoid generating empty JS files when JS files becomes empty but has CSS files imported (#1 (95fe5a7), closes #16078
- fix(css): handle lightningcss compiled css in Deno (#17301) (8e4e932), closes #17301
- fix(css): only use files the current bundle contains (#16684) (15a6ebb), closes #16684
- fix(css): page reload was not happening with .css?raw (#16455) (8041846), closes #16455
- fix(deps): update all non-major dependencies (#16603) (6711553), closes #16603
- fix(deps): update all non-major dependencies (#16660) (bf2f014), closes #16660
- fix(deps): update all non-major dependencies (#17321) (4a89766), closes #17321
- fix(error-logging): rollup errors weren't displaying id and codeframe (#16540) (22dc196), closes #16540
- fix(hmr): normalize the path info (#14255) (6a085d0), closes #14255
- fix(hmr): trigger page reload when calling invalidate on root module (#16636) (2b61cc3), closes #16636
- fix(logger): truncate log over 5000 characters long (#16581) (b0b839a), closes #16581
- fix(optimizer): log dependencies added by plugins (#16729) (f0fb987), closes #16729
- fix(sourcemap): improve sourcemap compatibility for vue2 (#16594) (913c040), closes #16594
- docs: correct proxy shorthand example (#15938) (abf766e), closes #15938
- docs: deprecate server.hot (#16741) (e7d38ab), closes #16741
v5.2.11
- feat: improve dynamic import variable failure error message (#16519) (f8feeea), closes #16519
- fix: dynamic-import-vars plugin normalize path issue (#16518) (f71ba5b), closes #16518
- fix: scripts and styles were missing from built HTML on Windows (#16421) (0e93f58), closes #16421
- fix(deps): update all non-major dependencies (#16488) (2d50be2), closes #16488
- fix(deps): update all non-major dependencies (#16549) (2d6a13b), closes #16549
- fix(dev): watch publicDir explicitly to include it outside the root (#16502) (4d83eb5), closes #16502
- fix(preload): skip preload for non-static urls (#16556) (bb79c9b), closes #16556
- fix(ssr): handle class declaration and expression name scoping (#16569) (c071eb3), closes #16569
- fix(ssr): handle function expression name scoping (#16563) (02db947), closes #16563
v5.2.10
- revert: perf: use workspace root for fs cache (#15712) (#16476) (77e7359), closes #15712 #16476
- fix: add base to virtual html (#16442) (721f94d), closes #16442
- fix: adjust esm syntax judgment logic (#16436) (af72eab), closes #16436
- fix: don't add outDirs to watch.ignored if emptyOutDir is false (#16453) (6a127d6), closes #16453
- fix(cspNonce): don't overwrite existing nonce values (#16415) (b872635), closes #16415
- feat: show warning if root is in build.outDir (#16454) (11444dc), closes #16454
- feat: write cspNonce to style tags (#16419) (8e54bbd), closes #16419
- chore(deps): update dependency eslint-plugin-n to v17 (#16381) (6cccef7), closes #16381
v5.2.9
- fix:
fsp.rm
removing files does not take effect (#16032) (b05c405), closes #16032 - fix: fix accumulated stacks in error overlay (#16393) (102c2fd), closes #16393
- fix(deps): update all non-major dependencies (#16376) (58a2938), closes #16376
- chore: update region comment (#16380) (77562c3), closes #16380
- perf: reduce size of injected __vite__mapDeps code (#16184) (c0ec6be), closes #16184
- perf(css): only replace empty chunk if imported (#16349) (e2658ad), closes #16349
v5.2.8
- fix: csp nonce injection when no closing tag (#16281) (#16282) (3c85c6b), closes #16281 #16282
- fix: do not access document in
/@​vite/client
when not defined (#16318) (646319c), closes #16318 - fix: fix sourcemap when using object as
define
value (#15805) (445c4f2), closes #15805 - fix(css): unknown file error happened with lightningcss (#16306) (01af308), closes #16306
- fix(hmr): multiple updates happened when invalidate is called while multiple tabs open (#16307) (21cc10b), closes #16307
- fix(scanner): duplicate modules for same id if glob is used in html-like types (#16305) (eca68fa), closes #16305
- chore(deps): update all non-major dependencies (#16325) (a78e265), closes #16325
- refactor: use types from sass instead of @types/sass (#16340) (4581e83), closes #16340
v5.2.7
- chore: deprecate splitVendorChunkPlugin (#16274) (45a06da), closes #16274
- fix: skip injecting
__vite__mapDeps
when it's not used (#16271) (890538a), closes #16271 - fix(deps): update all non-major dependencies (#16258) (7caef42), closes #16258
- fix(hmr): don't mutate module graph when collecting modules (#16302) (dfffea1), closes #16302
- fix(hmr): trigger hmr for missing file import errored module after file creation (#16303) (ffedc06), closes #16303
- fix(sourcemap): don't warn even if the sourcesContent is an empty string (#16273) (24e376a), closes #16273
- feat(hmr): reload when HTML file is created/deleted (#16288) (1f53796), closes #16288
v5.2.6
v5.2.5
- fix: avoid SSR requests in waitForRequestIdle (#16246) (7093f77), closes #16246
- docs: clarify enforce vs hook.order (#16226) (3a73e48), closes #16226
v5.2.4
v5.2.3
- fix: handle warmup request error correctly (#16223) (d7c5256), closes #16223
- fix: skip encode if is data uri (#16233) (8617e76), closes #16233
- fix(optimizer): fix
optimizeDeps.include
glob syntax for./*
exports (#16230) (f184c80), closes #16230 - fix(runtime): fix sourcemap with
prepareStackTrace
(#16220) (dad7f4f), closes #16220 - chore:
utf8
replaced withutf-8
(#16232) (9800c73), closes #16232
v5.2.2
v5.2.1
- chore: move to eslint flat config (#16743) (8f16765), closes #16743
- chore(deps): remove unused deps (#17329) (5a45745), closes #17329
- chore(deps): update all non-major dependencies (#16722) (b45922a), closes #16722
- fix: mention
build.rollupOptions.output.manualChunks
instead ofbuild.rollupOutput.manualChunks
(89378c0), closes #16721 - fix(build): make SystemJSWrapRE match lazy (#16633) (6583ad2), closes #16633
- fix(css): avoid generating empty JS files when JS files becomes empty but has CSS files imported (#1 (95fe5a7), closes #16078
- fix(css): handle lightningcss compiled css in Deno (#17301) (8e4e932), closes #17301
- fix(css): only use files the current bundle contains (#16684) (15a6ebb), closes #16684
- fix(css): page reload was not happening with .css?raw (#16455) (8041846), closes #16455
- fix(deps): update all non-major dependencies (#16603) (6711553), closes #16603
- fix(deps): update all non-major dependencies (#16660) (bf2f014), closes #16660
- fix(deps): update all non-major dependencies (#17321) (4a89766), closes #17321
- fix(error-logging): rollup errors weren't displaying id and codeframe (#16540) (22dc196), closes #16540
- fix(hmr): normalize the path info (#14255) (6a085d0), closes #14255
- fix(hmr): trigger page reload when calling invalidate on root module (#16636) (2b61cc3), closes #16636
- fix(logger): truncate log over 5000 characters long (#16581) (b0b839a), closes #16581
- fix(optimizer): log dependencies added by plugins (#16729) (f0fb987), closes #16729
- fix(sourcemap): improve sourcemap compatibility for vue2 (#16594) (913c040), closes #16594
- docs: correct proxy shorthand example (#15938) (abf766e), closes #15938
- docs: deprecate server.hot (#16741) (e7d38ab), closes #16741
v5.2.0
- fix: update client.ts@cleanUrl to accomodate blob protocol (#16182) (1a3b1d7), closes #16182
- fix(assets): avoid splitting
,
inside query parameter of image URI in srcset property (#16081) (50caf67), closes #16081 - chore(deps): update all non-major dependencies (#16186) (842643d), closes #16186
- perf(transformRequest): fast-path watch and sourcemap handling (#16170) (de60f1e), closes #16170
- docs: add
@shikiji/vitepress-twoslash
(#16168) (6f8a320), closes #16168
v5.1.8
Please refer to CHANGELOG.md for details.
v5.1.7
Please refer to CHANGELOG.md for details.
v5.1.6
- chore(deps): update all non-major dependencies (#16131) (a862ecb), closes #16131
- fix: check for publicDir before checking if it is a parent directory (#16046) (b6fb323), closes #16046
- fix: escape single quote when relative base is used (#16060) (8f74ce4), closes #16060
- fix: handle function property extension in namespace import (#16113) (f699194), closes #16113
- fix: server middleware mode resolve (#16122) (8403546), closes #16122
- fix(esbuild): update tsconfck to fix bug that could cause a deadlock (#16124) (fd9de04), closes #16124
- fix(worker): hide "The emitted file overwrites" warning if the content is same (#16094) (60dfa9e), closes #16094
- fix(worker): throw error when circular worker import is detected and support self referencing worker (eef9da1), closes #16103
- style(utils): remove null check (#16112) (0d2df52), closes #16112
- refactor(runtime): share more code between runtime and main bundle (#16063) (93be84e), closes #16063
v5.1.5
- fix:
__vite__mapDeps
code injection (#15732) (aff54e1), closes #15732 - fix: analysing build chunk without dependencies (#15469) (bd52283), closes #15469
- fix: import with query with imports field (#16085) (ab823ab), closes #16085
- fix: normalize literal-only entry pattern (#16010) (1dccc37), closes #16010
- fix: optimizeDeps.entries with literal-only pattern(s) (#15853) (49300b3), closes #15853
- fix: output correct error for empty import specifier (#16055) (a9112eb), closes #16055
- fix: upgrade esbuild to 0.20.x (#16062) (899d9b1), closes #16062
- fix(runtime): runtime HMR affects only imported files (#15898) (57463fc), closes #15898
- fix(scanner): respect
experimentalDecorators: true
(#15206) (4144781), closes #15206 - revert: "fix: upgrade esbuild to 0.20.x" (#16072) (11cceea), closes #16072
- refactor: share code with vite runtime (#15907) (b20d542), closes #15907
- refactor(runtime): use functions from
pathe
(#16061) (aac2ef7), closes #16061 - chore(deps): update all non-major dependencies (#16028) (7cfe80d), closes #16028
v5.1.4
- perf: remove unnecessary regex s modifier (#15766) (8dc1b73), closes #15766
- fix: fs cached checks disabled by default for yarn pnp (#15920) (8b11fea), closes #15920
- fix: resolve directory correctly when
fs.cachedChecks: true
(#15983) (4fe971f), closes #15983 - fix: srcSet with optional descriptor (#15905) (81b3bd0), closes #15905
- fix(deps): update all non-major dependencies (#15959) (571a3fd), closes #15959
- fix(watch): build watch fails when outDir is empty string (#15979) (1d263d3), closes #15979
v5.1.3
- fix: cachedTransformMiddleware for direct css requests (#15919) (5099028), closes #15919
- refactor(runtime): minor tweaks (#15904) (63a39c2), closes #15904
- refactor(runtime): seal ES module namespace object instead of feezing (#15914) (4172f02), closes #15914
v5.1.2
- fix: normalize import file path info (#15772) (306df44), closes #15772
- fix(build): do not output build time when build fails (#15711) (added3e), closes #15711
- fix(runtime): pass path instead of fileURL to
isFilePathESM
(#15908) (7b15607), closes #15908 - fix(worker): support UTF-8 encoding in inline workers (fixes #12117) (#15866) (570e0f1), closes #12117 #15866
- chore: update license file (#15885) (d9adf18), closes #15885
- chore(deps): update all non-major dependencies (#15874) (d16ce5d), closes #15874
- chore(deps): update dependency dotenv-expand to v11 (#15875) (642d528), closes #15875
v5.1.1
- fix: empty CSS file was output when only .css?url is used (#15846) (b2873ac), closes #15846
- fix: skip not only .js but also .mjs manifest entries (#15841) (3d860e7), closes #15841
- chore: post 5.1 release edits (#15840) (9da6502), closes #15840
v5.1.0
Vite 5.1 is out! Read the announcement blog post at https://vite.dev/blog/announcing-vite5-1!
- chore: revert #15746 (#15839) (ed875f8), closes #15746 #15839
- fix: pass
customLogger
toloadConfigFromFile
(fix #15824) (#15831) (55a3427), closes #15824 #15831 - fix(deps): update all non-major dependencies (#15803) (e0a6ef2), closes #15803
- refactor: remove
vite build --force
(#15837) (f1a4242), closes #15837
v5.0.13
Please refer to CHANGELOG.md for details.
v5.0.12
Please refer to CHANGELOG.md for details.
v5.0.11
- fix: don't pretransform classic script links (#15361) (19e3c9a), closes #15361
- fix: inject
__vite__mapDeps
code before sourcemap file comment (#15483) (d2aa096), closes #15483 - fix(assets): avoid splitting
,
inside base64 value ofsrcset
attribute (#15422) (8de7bd2), closes #15422 - fix(html): handle offset magic-string slice error (#15435) (5ea9edb), closes #15435
- chore(deps): update dependency strip-literal to v2 (#15475) (49d21fe), closes #15475
- chore(deps): update tj-actions/changed-files action to v41 (#15476) (2a540ee), closes #15476
v5.0.10
- fix: omit protocol does not require pre-transform (#15355) (d9ae1b2), closes #15355
- fix(build): use base64 for inline SVG if it contains both single and double quotes (#15271) (1bbff16), closes #15271
v5.0.9
- fix: htmlFallbackMiddleware for favicon (#15301) (c902545), closes #15301
- fix: more stable hash calculation for depsOptimize (#15337) (2b39fe6), closes #15337
- fix(scanner): catch all external files for glob imports (#15286) (129d0d0), closes #15286
- fix(server): avoid chokidar throttling on startup (#15347) (56a5740), closes #15347
- fix(worker): replace
import.meta
correctly for IIFE worker (#15321) (08d093c), closes #15321 - feat: log re-optimization reasons (#15339) (b1a6c84), closes #15339
- chore: temporary typo (#15329) (7b71854), closes #15329
- perf: avoid computing paths on each request (#15318) (0506812), closes #15318
- perf: temporary hack to avoid fs checks for /@react-refresh (#15299) (b1d6211), closes #15299
v5.0.8
- perf: cached fs utils (#15279) (c9b61c4), closes #15279
- fix: missing warmupRequest in transformIndexHtml (#15303) (103820f), closes #15303
- fix: public files map will be updated on add/unlink in windows (#15317) (921ca41), closes #15317
- fix(build): decode urls in CSS files (fix #15109) (#15246) (ea6a7a6), closes #15109 #15246
- fix(deps): update all non-major dependencies (#15304) (bb07f60), closes #15304
- fix(ssr): check esm file with normal file path (#15307) (1597170), closes #15307
v5.0.7
- fix: suppress terser warning if minify disabled (#15275) (3e42611), closes #15275
- fix: symbolic links in public dir (#15264) (ef2a024), closes #15264
- fix(html): skip inlining icon and manifest links (#14958) (8ad81b4), closes #14958
- chore: remove unneeded condition in getRealPath (#15267) (8e4655c), closes #15267
- perf: cache empty optimizer result (#15245) (8409b66), closes #15245
v5.0.6
- perf: in-memory public files check (#15195) (0f9e1bf), closes #15195
- chore: remove unneccessary eslint-disable-next-line regexp/no-unused-capturing-group (#15247) (35a5bcf), closes #15247
v5.0.5
- fix: emit
vite:preloadError
for chunks without deps (#15203) (d8001c5), closes #15203 - fix: esbuild glob import resolve error (#15140) (676804d), closes #15140
- fix: json error with position (#15225) (14be75f), closes #15225
- fix: proxy html path should be encoded (#15223) (5b85040), closes #15223
- fix(deps): update all non-major dependencies (#15233) (ad3adda), closes #15233
- fix(hmr): don't consider CSS dep as a circular dep (#15229) (5f2cdec), closes #15229
- feat: add '*.mov' to client.d.ts (#15189) (d93a211), closes #15189
- feat(server): allow disabling built-in shortcuts (#15218) (7fd7c6c), closes #15218
- chore: replace 'some' with 'includes' in resolveEnvPrefix (#15220) (ee12f30), closes #15220
- chore: update the website url for homepage in package.json (#15181) (282bd8f), closes #15181
- chore: update vitest to 1.0.0-beta.6 (#15194) (2fce647), closes #15194
- refactor: make HMR agnostic to environment (#15179) (0571b7c), closes #15179
- refactor: use dedicated regex methods (#15228) (0348137), closes #15228
- perf: remove debug only prettifyUrl call (#15204) (73e971f), closes #15204
- perf: skip computing sourceRoot in injectSourcesContent (#15207) (1df1fd1), closes #15207
v5.0.4
- fix: bindCLIShortcuts to proper server (#15162) (67ac572), closes #15162
- fix: revert "fix: js fallback sourcemap content should be using original content (#15135)" (#15178) (d2a2493), closes #15135 #15178
- fix(define): allow define process.env (#15173) (ec401da), closes #15173
- fix(resolve): respect order of browser in mainFields when resolving (#15137) (4a111aa), closes #15137
- feat: preserve vite.middlewares connect instance after restarts (#15166) (9474c4b), closes #15166
- refactor: align with Promise.withResolvers() (#15171) (642f9bc), closes #15171
v5.0.3
- fix:
generateCodeFrame
infinite loop (#15093) (6619de7), closes #15093 - fix: js fallback sourcemap content should be using original content (#15135) (227d56d), closes #15135
- fix(css): render correct asset url when CSS chunk name is nested (#15154) (ef403c0), closes #15154
- fix(css): use non-nested chunk name if facadeModule is not CSS file (#15155) (811e392), closes #15155
- fix(dev): bind plugin context functions (#14569) (cb3243c), closes #14569
- chore(deps): update all non-major dependencies (#15145) (7ff2c0a), closes #15145
- build: handle latest json-stable-stringify replacement (#15049) (bcc4a61), closes #15049
v5.0.2
v5.0.1
- fix: don't pretransform classic script links (#15361) (19e3c9a), closes #15361
- fix: inject
__vite__mapDeps
code before sourcemap file comment (#15483) (d2aa096), closes #15483 - fix(assets): avoid splitting
,
inside base64 value ofsrcset
attribute (#15422) (8de7bd2), closes #15422 - fix(html): handle offset magic-string slice error (#15435) (5ea9edb), closes #15435
- chore(deps): update dependency strip-literal to v2 (#15475) (49d21fe), closes #15475
- chore(deps): update tj-actions/changed-files action to v41 (#15476) (2a540ee), closes #15476
v5.0.0
Vite 5 is out! Read the announcement blog post here
Today, we mark another big milestone in Vite's path. The Vite team, contributors, and ecosystem partners, are excited to announce the release of Vite 5. Vite is now using Rollup 4, which already represents a big boost in build performance. And there are also new options to improve your dev server performance profile.
Vite 5 focuses on cleaning up the API (removing deprecated features) and streamlines several features closing long-standing issues, for example switching define
to use proper AST replacements instead of regexes. We also continue to take steps to future-proof Vite (Node.js 18+ is now required, and the CJS Node API has been deprecated).
Quick links:
Docs in other languages:
Learn more at the Vite 5 announcement blog post.
Breaking changes
- feat!: add isPreview to ConfigEnv and resolveConfig (#14855) (d195860), closes #14855
- fix(types)!: expose httpServer with Http2SecureServer union (#14834) (ab5bb40), closes #14834
- refactor(preview)!: use base middleware (#14818) (69737f4), closes #14818
- fix(html)!: align html serving between dev and preview (#14756) (4f71ae8), closes #14756
- refactor!: remove non boolean middleware mode (#14792) (deb5515), closes #14792
- refactor(esbuild)!: remove esbuild 0.17 -> 0.18 compat (#14804) (7234021), closes #14804
- feat(resolve)!: remove
resolve.browserField
(#14733) (43cc3b9), closes #14733 - refactor!: move side effect of restart server to the caller (#8746) (521ca58), closes #8746
- refactor(shortcuts)!: tweak shortcuts api (#14749) (0ae2e1d), closes #14749
- fix(resolve)!: remove special .mjs handling (#14723) (2141d31), closes #14723
- feat!: remove ssr proxy for externalized modules (#14521) (5786837), closes #14521
- feat(build)!: inline SVGs (#14643) (5acda5e), closes #14643
- fix!: worker.plugins is a function (#14685) (9d09dfe), closes #14685
- refactor!: remove https flag (#14681) (5b65bfd), closes #14681
- feat!: rollup v4 (#14508) (dee6067), closes #14508
- refactor!: remove
resolvePackageEntry
andresolvePackageData
APIs (#14584) (339f300), closes #14584 - refactor!: remove exporting internal APIs (#14583) (7861a33), closes #14583
- fix!: return 404 for resources requests outside the base path (#5657) (40fd2d9), closes #5657
- refactor!: remove
server.force
(#14530) (33ecfd9), closes #14530 - refactor!: remove jest condition (#14544) (8d18a91), closes #14544
- feat!: deprecate cjs node api (#14278) (404f30f), closes #14278
- feat(shortcuts)!: remove setRawMode (#14342) (536631a), closes #14342
- fix!: put manifest files in .vite directory by default (#14230) (74fa024), closes #14230
- feat!: allow path containing . to fallback to index.html (#14142) (1ae4cbd), closes #14142
- feat!: bump minimum node version to 18 (#14030) (2c1a45c), closes #14030
- fix!: avoid rewriting this (reverts #5312) (#14098) (9b7b4ed), closes #5312 #14098
- refactor!: merge
PreviewServerForHook
intoPreviewServer
type (#14119) (e0eb07c), closes #14119 - refactor(glob)!: remove
import.meta.globEager
(#14118) (fdfb61f), closes #14118 - feat!: add extension to internal virtual modules (#14231) (9594c70), closes #14231
- feat(css)!: remove css default export (b6c44cd)
- fix!: update node types peer dep range (#14280) (8f87e86), closes #14280
Features
- feat: allow providing parent httpServer on middleware mode (#14632) (e0c86d4), closes #14632
- style(client): overlay frame show scrollbar (#14701) (8aa4134), closes #14701
- feat: error when failed to resolve aliased import (#14973) (6a564fa), closes #14973
- feat: add invalid
rollupOptions
warnings (#14909) (7c240a0), closes #14909 - feat: skip initial clear screen if has logs (#14936) (a92bc61), closes #14936
- feat(hmr): add full reload reason (#14914) (60a020e), closes #14914
- feat(hmr): improve circular import updates (#14867) (b479055), closes #14867
- feat: implement AsyncDisposable (#14648) (385d580), closes #14648
- feat: expose parseAst and parseAstAsync from rollup (#14833) (6229485), closes #14833
- feat: upgrade rollup to 4.2.0 and use parseAstAsync (#14821) (86a5356), closes #14821
- feat(pluginContainer): implement watchChange hook (#14822) (9369d8d), closes #14822
- feat(server): add warmupRequest api (#14787) (8690581), closes #14787
- feat(define): handle replacement with esbuild (#11151) (e4c801c), closes #11151
- feat: add a runtime warning for the old object type transformIndexHtml hook (#14791) (17fb5ee), closes #14791
- feat: add server.warmup option (#14291) (da80372), closes #14291
- feat: add import-meta.d.ts (#14615) (598d423), closes #14615
- feat: add mdx as known js source (#14560) (dd213b5), closes #14560
- feat: add off method to ViteHotContext (issue #14185) (#14518) (31333bb), closes #14185 #14518
- feat: show better parse error in build (#14600) (84df7db), closes #14600
- feat(optimizer): check optimizeDeps.extensions for scannable files (#14543) (23ef8a1), closes #14543
- feat(ssr): support for ssr.resolve.conditions and ssr.resolve.externalConditions options (#14498) (d0afc39), closes #14498
- feat: show warning to discourage putting process/global to
define
option (#14447) (83a56f7), closes #14447 - feat(terser): add
maxWorkers
option for terserOptions (#13858) (884fc3d), closes #13858 - feat: add generic type for plugin api (#14238) (830b26e), closes #14238
- feat: allow passing down "null" to disable server watcher (#14208) (af5a95e), closes #14208
- feat: improve deno and bun support (#14379) (9884308), closes #14379
- feat: build.ssrEmitAssets out of experimental (#14055) (f88ab68), closes #14055
- feat: ssrTransform support import assertion by default (#14202) (70a379f), closes #14202
- feat: use
import.meta.url
instead ofself.location
(#14377) (e9b1e85), closes #14377 - feat: warn if # in project root (#14188) (f5ba696), closes #14188
- feat(css): stop injecting
?used
(fc05454) - feat: export
server.bindCLIShortcuts
(#13675) (1a2e5e6), closes #13675 - feat: copyPublicDir out of experimental (#14051) (443c235), closes #14051
- feat(css): build assets with the entry name when it is an entry point (#11578) (fd9a2cc), closes #11578
- feat(deps): upgrade rollup to 3.28.0 (#14049) (490dad8), closes #14049
- feat(worker): support a way to name the worker (#14032) (1f214a4), closes #14032
Performance
- perf(define): create simple regex for checks (#14788) (bd15537), closes #14788
- perf(hmr): implement soft invalidation (#14654) (4150bcb), closes #14654
- perf: pre transform requests while opening the browser (#12809) (96a4ce3), closes #12809
- chore(deps): update tsconfck to 3.0.0 (#14629) (4dcf9c4), closes #14629
- perf: reduce preload marker markup size (#14550) (6f12fd8), closes #14550
- perf: move up external url check before fs path checks (#13639) (c2ebea1), closes #13639
- refactor: update to tsconfck3 with lazy cache (#14234) (6e0b0ee), closes #14234
- perf: reduce one if judgment (#14329) (09ba7c6), closes #14329
- perf: replace startsWith with === (#14300) (75cd29c), closes #14300
- perf: replace fromEntries with a for loop (#14041) (8b174fd), closes #14041
- perf: use
URL.canParse
(#14068) (dcee6ef), closes #14068
Fixes
- fix: caret position was incorrect (#14984) (2b4e793), closes #14984
- fix: code frame was not generated for postcss errors (#14986) (bedfcfa), closes #14986
- fix: don't append
/@​fs/
for bare imports (#14995) (2a519a1), closes #14995 - fix: server.preTransformRequests https error (#14991) (#14993) (58ff849), closes #14991 #14993
- fix(ssr): skip esm proxy guard for namespace imports (#14988) (82a5b11), closes #14988
- fix: don't watch SPA fallback paths (#14953) (24c2c57), closes #14953
- fix: handle addWatchFile in load hooks (#14967) (a0ab85b), closes #14967
- fix: preload marker duplicate deps (#14955) (55335cc), closes #14955
- fix: relax overlay frame regex (#14979) (0b325bb), closes #14979
- fix(deps): update all non-major dependencies (#14961) (0bb3995), closes #14961
- fix(esbuild): set js loader for build transpile (#14980) (80beede), closes #14980
- fix(pluginContainer): run transform in this.load (#14965) (3f57b05), closes #14965
- fix:
server.headers
after restart in middleware mode (#14905) (f9ce9db), closes #14905 - fix: add watch in fallback file load (#14938) (b24b951), closes #14938
- fix: injectQuery check with double slash in the url (#14910) (84c5ff6), closes #14910
- fix(build): make build error message clearer (#14761) (350b4b2), closes #14761
- fix(css): correctly set manifest source name and emit CSS file (#14945) (28ccede), closes #14945
- fix(server): the server restart port should remain unchanged (#14418) (8b96e97), closes #14418
- fix(worker): prevent inject esm in classic workers (#14918) (2687dbb), closes #14918
- fix: file link in overlay with custom backend (#14879) (1bfb584), closes #14879
- fix: processNodeUrl for srcset (#14870) (0873bae), closes #14870
- fix: resovedUrls is null after server restart (#14890) (bd4d29f), closes #14890
- fix: use latest module graph in transform middleware (#14892) (b6b382c), closes #14892
- fix(assets): use base64 when inlining SVG with foreignObject tag (#14875) (9e20ed6), closes #14875
- fix(build): mixed external and transpiled srcset (#14888) (b5653d3), closes #14888
- fix(css): fix sourcemap warning in build with lightningCSS (#14871) (11b1796), closes #14871
- fix(css): initialize lightningCSS targets when not using options (#14872) (12f9230), closes #14872
- fix: use correct publicDir in ERR_LOAD_PUBLIC_URL (#14847) (66caef3), closes #14847
- fix(define): correctly replace same define values (#14786) (f36fcd2), closes #14786
- fix(deps): update all non-major dependencies (#14729) (d5d96e7), closes #14729
- fix(worker): force rollup to build workerImportMetaUrl under watch mode (#14712) (8db40ee), closes #14712
- fix: skip watchPackageDataPlugin for worker builds (#14762) (9babef5), closes #14762
- fix: suppress addWatchFile invalid phase error (#14751) (c3622d7), closes #14751
- fix(css): ensure code is valid after empty css chunk imports are removed (fix #14515) (#14517) (72f6a52), closes #14515 #14517
- fix(html): ignore rewrite external urls (#14774) (d6d1ef1), closes #14774
- fix(assets): fix svg inline in css url (#14714) (eef4aaa), closes #14714
- fix(resolve): make directory package.json check best effort (#14626) (d520388), closes #14626
- fix(assets): make timestamp invalidation lazy (#14675) (dd610b5), closes #14675
- fix(build): add crossorigin attribute to
link[rel="stylesheet"]
(#12991) (6e7b25c), closes #12991 - fix(hmr): clean importers in module graph when file is deleted (#14315) (7acb016), closes #14315
- fix(manifest): include assets referenced in html (#14657) (f627b91), closes #14657
- fix: avoid --open optimization if preTransformRequests is disabled (#14666) (d4f62e4), closes #14666
- fix(dynamic-import-vars): preserve custom query string (#14459) (1f2a982), closes #14459
- fix(hmr): add timestamp for assets in dev (#13371) (40ee245), closes #13371
- fix(html): srcset pointing image in public dir wasn't working during dev (#14663) (4496ae7), closes #14663
- fix(deps): update all non-major dependencies (#14635) (21017a9), closes #14635
- fix(esbuild): handle tsconfck cache undefined (#14650) (4e763c5), closes #14650
- fix: off-by-one bug in HTML whitespace removal (#14589) (f54e6d8), closes #14589
- fix(html): import expression in classic script for dev (#14595) (ea47b8f), closes #14595
- fix(html): inline style attribute not working in dev (#14592) (a4a17b8), closes #14592
- fix(html): relative paths without leading dot wasn't rewritten (#14591) (0a38e3b), closes #14591
- fix(proxy): correct the logic of bypass returning false (#14579) (261633a), closes #14579
- fix(optimizer): limit bundled file name length to 170 characters (#14561) (a3b6d8d), closes #14561
- fix: esbuild glob resolve error (#14533) (3615c68), closes #14533
- fix: update transform error message (#14139) (e0eb304), closes #14139
- fix(deps): update all non-major dependencies (#14510) (eb204fd), closes #14510
- fix(deps): update all non-major dependencies (#14559) (6868480), closes #14559
- fix(lib): esbuild helper functions injection not working with named exports (#14539) (5004d00), closes #14539
- fix: allow path ending with .html to fallback to index.html (dae6d0a)
- fix: handle fs.realpath.native MAX_PATH issue for Node.js <18.10 (#14487) (17c5928), closes #14487
- fix: update .html fallback in MPA (b5637a7)
- fix(analysis): warnings for dynamic imports that use static template literals (#14458) (ec7ee22), closes #14458
- fix(hmr): dev mode reduce unnecessary restart (#14426) (6f9d39d), closes #14426
- fix(import-analysis): preserve importedUrls import order (#14465) (99b0645), closes #14465
- fix(preview): allow path containing . to fallback to index.html (fddc151)
- fix(resolve): support submodules of optional peer deps (#14489) (f80ff77), closes #14489
- fix: handle errors during
hasWorkspacePackageJSON
function (#14394) (c3e4791), closes #14394 - fix: unify css collecting order (#11671) (20a8a15), closes #11671
- fix(deps): update all non-major dependencies (#14092) (68638f7), closes #14092
- fix(deps): update all non-major dependencies (#14460) (b77bff0), closes #14460
- fix(deps): update dependency dotenv-expand to v10 (#14391) (d6bde8b), closes #14391
- fix: omit 'plugins' since it has no effect (#13879) (64888b0), closes #13879
- fix: typo (#14334) (30df500), closes #14334
- fix: typo (#14337) (6ffe070), closes #14337
- fix: use relative path for sources field (#14247) (a995907), closes #14247
- fix(manifest): preserve pure css chunk assets (#14297) (4bf31e5), closes #14297
- fix(resolve): support
pkg?query
(21bbceb) - fix(sourcemap): dont inject fallback sourcemap if have existing (#14370) (55a3b4f), closes #14370
- fix(worker): inline es worker does not work in build mode (#14307) (7371c5c), closes #14307
- fix: add source map to Web Workers (fix #14216) (#14217) (6f86de3), closes #14216 #14217
- fix: handle sourcemap correctly when multiple line import exists (#14232) (627159d), closes #14232
- fix: include
vite/types/*
in exports field (#14296) (66a97be), closes #14296 - fix: use string manipulation instead of regex to inject esbuild helpers (#14094) (91a18c2), closes #14094
- fix(cli): convert special base (#14283) (34826aa), closes #14283
- fix(css): remove pure css chunk sourcemap (#14290) (2b80089), closes #14290
- fix(css): reset render cache on renderStart (#14326) (19bf0f1), closes #14326
- fix(css): spread lightningcss options (#14313) (80c6608), closes #14313
- fix(optimizer): define crawlDeps after scanProcessing and optimizationResult are complete (fix #1428 (c5f6558), closes #14284 #14285
- fix(vite): precisely check if files are in dirs (#14241) (245d186), closes #14241
- revert: "fix(css): spread lightningcss options (#14024)" (#14209) (5778365), closes #14024 #14209
- fix: breakpoints in JS not working (#13514) (0156bd2), closes #13514
- fix: if host is specified check whether it is valid (#14013) (c39e6c1), closes #14013
- fix: initWasm options should be optional (#14152) (387a6e8), closes #14152
- fix: rollup watch crash on Windows (#13339) (4f582c9), closes #13339
- fix: ws never connects after restarting server if server.hmr.server is set (#14127) (bd9b749), closes #14127
- fix(client): correctly display the config file name (#14160) (61e801d), closes #14160
- fix(css): spread lightningcss options (#14024) (63a4451), closes #14024
- fix(css): trim esbuild's minified css (#13893) (7682a62), closes #13893
- fix(glob): trigger HMR for glob in a package (#14117) (86cbf69), closes #14117
Cleanup
- docs: point links in messages at https: (#14992) (d3af879), closes #14992
- build: dont strip single line comments (#14969) (ea9ccb7), closes #14969
- build: strip internal parameters (1168e57)
- chore: refactor as functions (5684382)
- chore: add
PluginWithRequiredHook
type & extractgetHookHandler
function (#14845) (997f2d5), closes #14845 - chore(optimizedDeps): remove unused return (#14773) (9d744dd), closes #14773
- refactor: simplify build optimizer node_env handling (#14829) (275907b), closes #14829
- chore: fix typo (#14820) (eda1247), closes #14820
- chore: revert "feat: show warning to discourage putting process/global to
define
option (#14447)" (0426910), closes #14447 #14827 - chore: update license (#14790) (ac5d8a7), closes #14790
- chore(shortcuts): resolve generic type error (#14802) (a090742), closes #14802
- refactor: update es-module-lexer to 1.4.0 (#14937) (374e6fd), closes #14937
- chore(esbuild): fix typo (#14772) (6cfc1e2), closes #14772
- revert: remove AsyncDisposable (#14908) (b953b0d), closes #14908
- refactor(ssr): remove unused metadata code (#14711) (c5f2d60), closes #14711
- refactor: use dynamic import directly (#14661) (af60592), closes #14661
- chore(config): improve the readability of warning messages (#14594) (b43b4df), closes #14594
- build: clean generated type file (#14582) (fffe16e), closes #14582
- build: use rollup-plugin-dts (#14571) (d89725b), closes #14571
- refactor(css): make
getEmptyChunkReplacer
for unit test (#14528) (18900fd), closes #14528 - refactor: ensure HTML is stripped of generated blank lines (#14274) (bc97091), closes #14274
- refactor: remove unused record flatIdToExports (#14557) (7e62710), closes #14557
- test(ssr): add import and export ordering snapshot (#14468) (ca34c64), closes #14468
- refactor: remove CJS ssr output format (#13944) (2f60b9e), closes #13944
- refactor: replace duplicate code with tryStatSync (#14461) (be6b0c8), closes #14461
- refactor(config): remove unnecessary esbuild option (#13580) (67f4e52), closes #13580
- test(ssr): proper test coverage of SSR shebang import hoisting (#14448) (fdd4669), closes #14448
- chore(optimizer): debug info on cache dir handle process (#12858) (21a62da), closes #12858
- refactor(css): remove
export {}
(98fbdc3) - chore: fix ts error (#14053) (6cb397f), closes #14053
- chore: use "kB" everywhere with the correct definition (#14061) (f97ef58), closes #14061
- chore(client): remove redundant if statement (#14137) (fe1c0b9), closes #14137
- refactor(css): use
preliminaryFileName
to detect pure CSS chunks (#13974) (835249d), closes #13974
Previous Changelogs
5.0.0-beta.20 (2023-11-15)
5.0.0-beta.19 (2023-11-14)
5.0.0-beta.18 (2023-11-11)
5.0.0-beta.17 (2023-11-07)
5.0.0-beta.16 (2023-11-03)
5.0.0-beta.15 (2023-11-01)
5.0.0-beta.14 (2023-10-30)
5.0.0-beta.13 (2023-10-27)
5.0.0-beta.12 (2023-10-23)
5.0.0-beta.11 (2023-10-19)
5.0.0-beta.10 (2023-10-17)
5.0.0-beta.9 (2023-10-17)
5.0.0-beta.8 (2023-10-16)
5.0.0-beta.7 (2023-10-12)
5.0.0-beta.6 (2023-10-10)
5.0.0-beta.5 (2023-10-09)
5.0.0-beta.4 (2023-10-02)
5.0.0-beta.3 (2023-09-25)
5.0.0-beta.2 (2023-09-15)
5.0.0-beta.1 (2023-09-08)
5.0.0-beta.0 (2023-08-24)
v4.5.5
Please refer to CHANGELOG.md for details.
v4.5.3
Please refer to CHANGELOG.md for details.
v4.5.2
Please refer to CHANGELOG.md for details.
v4.5.1
Please refer to CHANGELOG.md for details.
v4.5.0
- feat: backport mdx as known js source (#14560) (#14670) (45595ef), closes #14560 #14670
- feat: scan .marko files (#14669) (ed7bdc5), closes #14669
- feat(ssr): backport ssr.resolve.conditions and ssr.resolve.externalConditions (#14498) (#14668) (520139c), closes #14498 #14668
v4.4.12
Please refer to CHANGELOG.md for details.
v4.4.11
- revert: "fix: use string manipulation instead of regex to inject esbuild helpers (54e1275), closes #14094
v4.4.10
- fix: add source map to Web Workers (fix #14216) (#14217) (df6f32f), closes #14216 #14217
- fix: handle errors during
hasWorkspacePackageJSON
function (#14394) (6f6e5de), closes #14394 - fix: handle sourcemap correctly when multiple line import exists (#14232) (218861f), closes #14232
- fix: if host is specified check whether it is valid (#14013) (b1b816a), closes #14013
- fix: include
vite/types/*
in exports field (#14296) (40e99a1), closes #14296 - fix: initWasm options should be optional (#14152) (119c074), closes #14152
- fix: restore builtins list (f8b9adb)
- fix: use string manipulation instead of regex to inject esbuild helpers (#14094) (128ad8f), closes #14094
- fix: ws never connects after restarting server if server.hmr.server is set (#14127) (441642e), closes #14127
- fix(analysis): warnings for dynamic imports that use static template literals (#14458) (0c6d289), closes #14458
- fix(cli): convert special base (#14283) (d4bc0fb), closes #14283
- fix(css): remove pure css chunk sourcemap (#14290) (cd7e033), closes #14290
- fix(css): reset render cache on renderStart (#14326) (d334b3d), closes #14326
- fix(glob): trigger HMR for glob in a package (#14117) (0f582bf), closes #14117
- fix(import-analysis): preserve importedUrls import order (#14465) (269aa43), closes #14465
- fix(manifest): preserve pure css chunk assets (#14297) (3d63ae6), closes #14297
- fix(optimizer): define crawlDeps after scanProcessing and optimizationResult are complete (fix #1428 (fcaf749), closes #14284 #14285
- fix(resolve): support submodules of optional peer deps (#14489) (104971d), closes #14489
- fix(vite): precisely check if files are in dirs (#14241) (c4758d1), closes #14241
- feat: improve deno and bun support (#14379) (8bc1f9d), closes #14379
v4.4.9
- chore: fix eslint warnings (#14031) (4021a0e), closes #14031
- chore(deps): update all non-major dependencies (#13938) (a1b519e), closes #13938
- fix: dynamic import vars ignored warning (#14006) (4479431), closes #14006
- fix(build): silence warn dynamic import module when inlineDynamicImports true (#13970) (7a77aaf), closes #13970
- perf: improve build times and memory utilization (#14016) (9d7d45e), closes #14016
- perf: replace startsWith with === (#14005) (f5c1224), closes #14005
v4.4.8
- fix: modulePreload false (#13973) (488085d), closes #13973
- fix: multiple entries with shared css and no JS (#13962) (89a3db0), closes #13962
- fix: use file extensions on type imports so they work with
moduleResolution: 'node16'
(#13947) (aeef670), closes #13947 - fix(css): enhance error message for missing preprocessor dependency (#11485) (65e5c22), closes #11485
- fix(esbuild): fix static properties transpile when useDefineForClassFields false (#13992) (4ca7c13), closes #13992
- fix(importAnalysis): strip url base before passing as safeModulePaths (#13712) (1ab06a8), closes #13712
- fix(importMetaGlob): avoid unnecessary hmr of negative glob (#13646) (844451c), closes #13646
- fix(optimizer): avoid double-commit of optimized deps when discovery is disabled (#13865) (df77991), closes #13865
- fix(optimizer): enable experimentalDecorators by default (#13981) (f8a5ffc), closes #13981
- perf: replace startsWith with === (#13989) (3aab14e), closes #13989
- perf: single slash does not need to be replaced (#13980) (66f522c), closes #13980
- perf: use Intl.DateTimeFormatter instead of toLocaleTimeString (#13951) (af53a1d), closes #13951
- perf: use Intl.NumberFormat instead of toLocaleString (#13949) (a48bf88), closes #13949
- perf: use magic-string hires boundary for sourcemaps (#13971) (b9a8d65), closes #13971
- chore(reporter): remove unnecessary map (#13972) (dd9d4c1), closes #13972
- refactor: add new overload to the type of defineConfig (#13958) (24c12fe), closes #13958
v4.4.7
- fix:
optimizeDeps.include
not working with paths inside packages (#13922) (06e4f57), closes #13922 - fix: lightningcss fails with html-proxy (#13776) (6b56094), closes #13776
- fix: prepend
config.base
to vite/env path (#13941) (8e6cee8), closes #13941 - fix(html): support
import.meta.env
define replacement without quotes (#13425) (883089c), closes #13425 - fix(proxy): handle error when proxy itself errors (#13929) (4848e41), closes #13929
- chore(eslint): allow type annotations (#13920) (d1264fd), closes #13920
v4.4.6
- fix: constrain inject helpers for iife (#13909) (c89f677), closes #13909
- fix: display manualChunks warning only when a function is not used (#13797) (#13798) (51c271f), closes #13797 #13798
- fix: do not append
browserHash
on optimized deps during build (#13906) (0fb2340), closes #13906 - fix: use Bun's implementation of
ws
instead of the bundled one (#13901) (049404c), closes #13901 - feat(client): add guide to press Esc for closing the overlay (#13896) (da389cc), closes #13896
v4.4.5
- fix: "EISDIR: illegal operation on a directory, realpath" error on RA… (#13655) (6bd5434), closes #13655
- fix: transform error message add file info (#13687) (6dca41c), closes #13687
- fix: warn when publicDir and outDir are nested (#13742) (4eb3154), closes #13742
- fix(build): remove warning about ineffective dynamic import from node_modules (#13884) (33002dd), closes #13884
- fix(build): style insert order for UMD builds (fix #13668) (#13669) (49a1b99), closes #13668 #13669
- fix(deps): update all non-major dependencies (#13872) (975a631), closes #13872
- fix(types): narrow down the return type of
defineConfig
(#13792) (c971f26), closes #13792 - chore: fix typos (#13862) (f54e8da), closes #13862
- chore: replace
any
withstring
(#13850) (4606fd8), closes #13850 - chore(deps): update dependency prettier to v3 (#13759) (5a56941), closes #13759
- docs: fix build.cssMinify link (#13840) (8a2a3e1), closes #13840
v4.4.4
- chore: warning about ssr cjs format removal (#13827) (4646e9f), closes #13827
- fix(esbuild): enable experimentalDecorators by default (#13805) (e8880f0), closes #13805
- fix(scan): skip tsconfigRaw fallback if tsconfig is set (#13823) (b6155a1), closes #13823
- feat(client): close
vite-error-overlay
with Escape key (#13795) (85bdcda), closes #13795
v4.4.3
- fix: avoid early error when server is closed in ssr (#13787) (89d01eb), closes #13787
- fix(deps): update all non-major dependencies (#13758) (8ead116), closes #13758
- fix(server): remove restart guard on restart (#13789) (2a38ef7), closes #13789
v4.4.2
v4.4.1
- revert: "fix: use string manipulation instead of regex to inject esbuild helpers (54e1275), closes #14094
v4.4.0
Experimental support for Lightning CSS
Starting from Vite 4.4, there is experimental support for Lightning CSS. You can opt into it by adding css.transformer: 'lightningcss'
to your config file and install the optional lightningcss
dev dependency. If enabled, CSS files will be processed by Lightning CSS instead of PostCSS.
Lightning CSS can also be used as the CSS minifier with build.cssMinify: 'lightningcss'
.
See beta docs at the Lighting CSS guide.
esbuild 0.18 update
esbuild 0.18 contains backwards-incompatible changes to esbuild's handling of tsconfig.json
files. We think they shouldn't affect Vite users, you can review #13525 for more information.
Templates for Solid and Qwik in create-vite
New starter templates have been added to create-vite for Solid and Qwik. Try them online at vite.new/solid-ts and vite.new/qwik-ts.
Korean Translation
Vite's docs are now translated to Korean, available at ko.vite.dev.
Features
- feat: preview mode add keyboard shortcuts (#12968) (126e93e), closes #12968
- feat: asset type add apng (#13294) (a11b6f6), closes #13294
- feat: emit event to handle chunk load errors (#12084) (2eca54e), closes #12084
- feat: import public non-asset URL (#13422) (3a98558), closes #13422
- feat: support files for
fs.allow
(#12863) (4a06e66), closes #12863 - feat(build): warn dynamic import module with a static import alongside (#12850) (127c334), closes #12850
- feat(client): add debounce on page reload (#13545) (d080b51), closes #13545
- feat(client): add WebSocket connections events (#13334) (eb75103), closes #13334
- feat(config): friendly ESM file require error (#13283) (b9a6ba0), closes #13283
- feat(css): add support for Lightning CSS (#12807) (c6c5d49), closes #12807
- feat(css): support at import preprocessed styles (#8400) (2bd6077), closes #8400
- feat(html): support image set in inline style (#13473) (2c0faba), closes #13473
- feat(importMetaGlob): support sub imports pattern (#12467) (e355c9c), closes #12467
- feat(optimizer): support glob includes (#12414) (7792515), closes #12414
- feat!: update esbuild to 0.18.2 (#13525) (ab967c0), closes #13525
Bug Fixes
- fix: check document before detect script rel (#13559) (be4b0c0), closes #13559
- fix(define): stringify object parse error in build mode (#13600) (71516db), closes #13600
- fix(deps): update all non-major dependencies (#13701) (02c6bc3), closes #13701
- fix(esbuild): use
useDefineForClassFields: false
when nocompilerOptions.target
is declared (#13 (7ef2472), closes #13708 - fix(pluginContainer): drop previous sourcesContent (#13722) (9310b3a), closes #13722
- fix: lightningCSS should load external URL in CSS file (#13692) (8517645), closes #13692
- fix: shortcut open browser when set host (#13677) (6f1c55e), closes #13677
- fix(cli): convert the sourcemap option to boolean (fix #13638) (#13663) (d444bfe), closes #13638 #13663
- fix(css): use esbuild legalComments config when minifying CSS (#13661) (2d9008e), closes #13661
- fix(sourcemap): preserve original sourcesContent (#13662) (f6362b6), closes #13662
- fix(ssr): transform superclass identifier (#13635) (c5b2c8f), closes #13635
- fix: show error position (#13623) (90271a6), closes #13623
- fix(hmr): only invalidate
lastHMRTimestamp
of importers if the invalidated module is not a HMR bou (1143e0b), closes #13024 - fix(indexHtml): decode html URI (#13581) (f8868af), closes #13581
- fix: avoid binding ClassExpression (#13572) (1a0c806), closes #13572
- fix: the shortcut fails to open browser when set the host (#13579) (e0a48c5), closes #13579
- fix(proxy): forward SSE close event (#13578) (4afbccb), closes #13578
- fix: allow using vite as a proxy for another vite server (#13218) (711dd80), closes #13218
- fix: await requests to before server restart (#13262) (0464398), closes #13262
- fix: esm detection with
export const { A, B }
pattern (#13483) (ea1bcc9), closes #13483 - fix: keep track of ssr version of imported modules separately (#11973) (8fe6952), closes #11973
- fix: make optimize error available to meta-framework (#13495) (b70e783), closes #13495
- fix: only show the listened IP when host is specified (#13412) (20b0cae), closes #13412
- fix: race condition creation module in graph in transformRequest (#13085) (43cbbcf), closes #13085
- fix: remove deprecated config.server.base (#13482) (dc597bd), closes #13482
- fix: remove extra path shorten when resolving from a dir (#13381) (5503198), closes #13381
- fix: show network URLs when
--host 0.0.0.0
(#13438) (00ee8c1), closes #13438 - fix: timestamp config dynamicImport (#13502) (6a87c65), closes #13502
- fix: unexpected config temporary file (#13269) (ff3ce31), closes #13269
- fix: use consistent virtual module ID in module graph (#13073) (aa1776f), closes #13073
- fix(build): make output warning message clearer (#12924) (54ab3c8), closes #12924
- fix(debug): import performance from perf_hooks (#13464) (d458ccd), closes #13464
- fix(deps): update all non-major dependencies (#13059) (123ef4c), closes #13059
- fix(deps): update all non-major dependencies (#13488) (bd09248), closes #13488
- fix(deps): update sirv to 2.0.3 (#13057) (d814d6c), closes #13057
- fix(mergeConfig): don't accept callback config (#13135) (998512b), closes #13135
- fix(optimizer): include exports for css modules (#13519) (1fd9919), closes #13519
- fix(resolve): always use
module
condition (#13370) (367920b), closes #13370 - fix(ssr): fix crash when a pnpm/Yarn workspace depends on a CJS package (#9763) (9e1086b), closes #9763
Previous Changelogs
4.4.0-beta.4 (2023-07-03)
4.4.0-beta.3 (2023-06-25)
4.4.0-beta.2 (2023-06-22)
4.4.0-beta.1 (2023-06-21)
4.4.0-beta.0 (2023-06-20)
v4.3.9
- fix: fs.deny with leading double slash (#13348) (813ddd6), closes #13348
- fix: optimizeDeps during build and external ids (#13274) (e3db771), closes #13274
- fix(css): return deps if have no postcss plugins (#13344) (28923fb), closes #13344
- fix(legacy): style insert order (#13266) (e444375), closes #13266
- chore: revert prev release commit (2a30a07)
- release: v4.3.9 (5c9abf7)
- docs: optimizeDeps.needsInterop (#13323) (b34e79c), closes #13323
- test: respect commonjs options in playgrounds (#13273) (19e8c68), closes #13273
- refactor: simplify SSR options' if statement (#13254) (8013a66), closes #13254
- perf(ssr): calculate stacktrace offset lazily (#13256) (906c4c1), closes #13256
v4.3.8
- fix: avoid outdated module to crash in importAnalysis after restart (#13231) (3609e79), closes #13231
- fix(ssr): skip updateCjsSsrExternals if legacy flag disabled (#13230) (13fc345), closes #13230
v4.3.7
- fix: revert only watch .env files in envDir (#12587) (#13217) (0fd4616), closes #12587 #13217
- fix(assetImportMetaUrl): allow ternary operator in template literal urls (#13121) (d5d9a31), closes #13121
v4.3.6
- fix: avoid dev-server crash when ws proxy error (#12829) (87e1f58), closes #12829
- fix: call
tryFsResolve
for relativenew URL(foo, import.meta.url)
(#13142) (eeb0617), closes #13142 - fix: don't inject CSS sourcemap for direct requests (#13115) (7d80a47), closes #13115
- fix: handle more yarn pnp load errors (#13160) (adf61d9), closes #13160
- fix(build): declare moduleSideEffects for vite:modulepreload-polyfill (#13099) (d63129b), closes #13099
- fix(css): respect
esbuild.charset
when minify (#13190) (4fd35ed), closes #13190 - fix(server): intercept ping requests (#13117) (d06cc42), closes #13117
- fix(ssr): stacktrace uses abs path with or without sourcemap (#12902) (88c855e), closes #12902
- perf: skip windows absolute paths for node resolve (#13162) (e640939), closes #13162
- chore: remove useless dep (#13165) (9a7ec98), closes #13165
- chore(reporter): reuse clearLine (#13156) (535795a), closes #13156
v4.3.5
- fix: location is not defined error in cleanScssBugUrl (#13100) (91d7b67), closes #13100
- fix: unwrapId and pass ssr flag when adding to moduleGraph in this.load (#13083) (9041e19), closes #13083
- fix(assetImportMetaUrl): reserve dynamic template literal query params (#13034) (7089528), closes #13034
- fix(debug): skip filter object args (#13098) (d95a9af), closes #13098
- fix(scan): handle html script tag attributes that contain ">" (#13101) (8a37de6), closes #13101
- fix(ssr): ignore __esModule for ssrExportAll (#13084) (8a8ea1d), closes #13084
v4.3.4
- fix(define): incorrect raw expression value type in build (#13003) (8f4cf07), closes #13003
- fix(importAnalysisBuild): support parsing 'VITE_PRELOAD' (#13023) (447df7c), closes #13023
- fix(server): should respect hmr port when middlewareMode=false (#13040) (1ee0014), closes #13040
- fix(ssr): track for statements as block scope (#13021) (2f8502f), closes #13021
- chore: add changelog for vite 4.2.2 and 3.2.6 (#13055) (0c9f1f4), closes #13055
v4.3.3
- fix: address file path mismatch when loading Vite config file on Windows (fix #12923) (#13005) (84c4118), closes #12923 #13005
- fix: undefined document in worker (#12988) (08c1452), closes #12988
- fix(resolve): deep import resolvedId error (#13010) (30a41ff), closes #13010
- feat: optimize deps option to turn off auto discovery (#13000) (bd86375), closes #13000
- chore(deps): update all non-major dependencies (#12805) (5731ac9), closes #12805
v4.3.2
- fix: status optional in windows network drive regex (fix: #12948) (#12949) (f781fc6), closes #12948 #12949
- fix: use realpathSync for node <16.18 on windows (#12971) (965839c), closes #12971
- fix(ssr): hoist statements after hashbang (#12985) (07bd6d1), closes #12985
- chore: build time message setting color (#12940) (ada7cd5), closes #12940
- chore: remove extra ) in changelog (#12932) (e7924d2), closes #12932
- chore: upgrade rollup (#12965) (bdb2f25), closes #12965
- refactor: resolveExports (#10917) (ad21ec3), closes #10917
v4.3.1
- fix: revert ensure module in graph before transforming (#12774) (#12929) (9cc93a5), closes #12774 #12929
- docs: 4.3 announcement and release notes (#12925) (f29c582), closes #12925
- chore: clean up 4.3 changelog (55ec023)
v4.3.0
Vite 4.3 is out! Read the announcement blog post here
In this minor, we focused on improving the dev server performance. The resolve logic got streamlined, improving hot paths and implementing smarter caching for finding package.json
, TS config files, and resolved URL in general.
You can read a detailed walkthrough of the performance work done in this blog post by one of Vite Contributors: How we made Vite 4.3 faaaaster
This sprint resulted in speed improvements across the board compared to Vite 4.2.
These are the performance improvements as measured by sapphi-red/performance-compare, which tests an app with 1000 React Components cold and warm dev server startup time as well as HMR times for a root and a leaf component:
Vite (babel) | Vite 4.2 | Vite 4.3 | Improvement |
---|---|---|---|
dev cold start | 17249.0ms | 5132.4ms | -70.2% |
dev warm start | 6027.8ms | 4536.1ms | -24.7% |
Root HMR | 46.8ms | 26.7ms | -42.9% |
Leaf HMR | 27.0ms | 12.9ms | -52.2% |
Vite (swc) | Vite 4.2 | Vite 4.3 | Improvement |
---|---|---|---|
dev cold start | 13552.5ms | 3201.0ms | -76.4% |
dev warm start | 4625.5ms | 2834.4ms | -38.7% |
Root HMR | 30.5ms | 24.0ms | -21.3% |
Leaf HMR | 16.9ms | 10.0ms | -40.8% |
You can read more information about the benchmark here
Features
- feat: expose
isFileServingAllowed
as public utility (#12894) (93e095c), closes #12894 - feat: reuse existing style elements in dev (#12678) (3a41bd8), closes #12678
- feat: skip pinging the server when the tab is not shown (#12698) (bedcd8f), closes #12698
- feat(create-vite): use typescript 5.0 in templates (#12481) (8582e2d), closes #12481
- feat: use preview server parameter in preview server hook (#11647) (4c142ea), closes #11647
- feat(reporter): show gzip info for all compressible files (fix #11288) (#12485) (03502c8), closes #11288 #12485
- feat(server): allow to import
data:
uris (#12645) (4886d9f), closes #12645 - feat: add opus filetype to assets & mime types (#12526) (63524ba), closes #12526
Performance
- perf: parallelize await exportsData from depsInfo (#12869) (ab3a530), closes #12869
- perf: avoid side effects resolving in dev and in the optimizer/scanner (#12789) (fb904f9), closes #12789
- perf: parallelize imports processing in import analysis plugin (#12754) (037a6c7), closes #12754
- perf: unresolvedUrlToModule promise cache (#12725) (80c526e), closes #12725
- perf(resolve): avoid tryFsResolve for /@fs/ paths (#12450) (3ef8aaa), closes #12450
- perf(resolve): reduce vite client path checks (#12471) (c49af23), closes #12471
- perf: avoid new URL() in hot path (#12654) (f4e2fdf), closes #12654
- perf: improve isFileReadable performance (#12397) (acf3a14), closes #12397
- perf: module graph url shortcuts (#12635) (c268cfa), closes #12635
- perf: reduce runOptimizerIfIdleAfterMs time (#12614) (d026a65), closes #12614
- perf: shorcircuit resolve in ensure entry from url (#12655) (82137d6), closes #12655
- perf: skip es-module-lexer if have no dynamic imports (#12732) (5d07d7c), closes #12732
- perf: start preprocessing static imports before updating module graph (#12723) (c90b46e), closes #12723
- perf: use package cache for one off resolve (#12744) (77bf4ef), closes #12744
- perf(css): cache lazy import (#12721) (fedb080), closes #12721
- perf(hmr): keep track of already traversed modules when propagating update (#12658) (3b912fb), closes #12658
- perf(moduleGraph): resolve dep urls in parallel (#12619) (4823fec), closes #12619
- perf(resolve): skip for virtual files (#12638) (9e13f5f), closes #12638
- perf: avoid fsp.unlink if we don't use the promise (#12589) (19d1980), closes #12589
- perf: back to temporal optimizer dirs (#12622) (8da0422), closes #12622
- perf: cache
depsCacheDirPrefix
value forisOptimizedDepFile
(#12601) (edbd262), closes #12601 - perf: improve cleanUrl util (#12573) (68d500e), closes #12573
- perf: non-blocking write of optimized dep files (#12603) (2f5f968), closes #12603
- perf: try using realpathSync.native in Windows (#12580) (1cc99f8), closes #12580
- perf: use fsp in more cases (#12553) (e9b92f5), closes #12553
- perf(html): apply preTransformRequest for html scripts (#12599) (420782c), closes #12599
- perf(optimizer): bulk optimizer delay (#12609) (c881971), closes #12609
- perf(optimizer): start optimizer early (#12593) (4f9b8b4), closes #12593
- perf(resolve): avoid isWorkerRequest and clean up .ts imported a .js (#12571) (8ab1438), closes #12571
- perf(resolve): findNearestMainPackageData instead of lookupFile (#12576) (54b376f), closes #12576
- perf(server): only watch .env files in envDir (#12587) (26d8e72), closes #12587
- perf: avoid execSync on openBrowser (#12510) (a2af2f0), closes #12510
- perf: extract regex and use Map in data-uri plugin (#12500) (137e63d), closes #12500
- perf: extract vite:resolve internal functions (#12522) (6ea4be2), closes #12522
- perf: improve package cache usage (#12512) (abc2b9c), closes #12512
- perf: more regex improvements (#12520) (abf536f), closes #12520
- perf: regex to startsWith/slice in utils (#12532) (debc6e2), closes #12532
- perf: remove regex in ImportMetaURL plugins (#12502) (1030049), closes #12502
- perf: replace endsWith with === (#12539) (7eb52ec), closes #12539
- perf: replace startsWith with === (#12531) (9cce026), closes #12531
- perf: reuse regex in plugins (#12518) (da43936), closes #12518
- perf: use
safeRealpath
ingetRealpath
(#12551) (cec2320), closes #12551 - perf(css): improve postcss config resolve (#12484) (58e99b6), closes #12484
- perf(esbuild): make tsconfck non-blocking (#12548) (e5cdff7), closes #12548
- perf(esbuild): update tsconfck to consume faster find-all implementation (#12541) (b6ea25a), closes #12541
- perf(resolve): fix browser mapping nearest package.json check (#12550) (eac376e), closes #12550
- perf(resolve): improve package.json resolve speed (#12441) (1fc8c65), closes #12441
- perf(resolve): refactor package.json handling for deep imports (#12461) (596b661), closes #12461
- perf(resolve): refactor tryFsResolve and tryResolveFile (#12542) (3f70f47)
- perf(resolve): skip absolute paths in root as url checks (#12476) (8d2931b), closes #12476
- perf(resolve): support # in path only for dependencies (#12469) (6559fc7), closes #12469
Bug Fixes
- fix(build): do not repeatedly output warning message (#12910) (251d0ab), closes #12910
- fix: escape msg in render restricted error html (#12889) (3aa2127), closes #12889
- fix: yarn pnp considerBuiltins (#12903) (a0e10d5), closes #12903
- fix: broken middleware name (#12871) (32bef57), closes #12871
- fix: cleanUpStaleCacheDirs once per process (#12847) (2c58b6e), closes #12847
- fix(build): do not warn when URL in CSS is externalized (#12873) (1510996), closes #12873
- fix: build time deps optimization, and ensure single crawl end call (#12851) (fa30879), closes #12851
- fix: correct vite config temporary name (#12833) (cdd9c23), closes #12833
- fix(importAnalysis): warning on ExportAllDeclaration (#12799) (5136b9b), closes #12799
- fix(optimizer): start optimizer after buildStart (#12832) (cfe75ee), closes #12832
- fix: handle try-catch for fs promise when resolve https config (#12808) (0bba402), closes #12808
- fix(build): correctly handle warning ignore list (#12831) (8830532), closes #12831
- fix(resolve): use different importer check for css imports (#12815) (d037327), closes #12815
- fix: ignore sideEffects for scripts imported from html (#12786) (f09551f), closes #12786
- fix: warn on build when bundling code that uses nodejs built in module (#12616) (72050f9), closes #12616
- fix(cli): pass mode to optimize command (#12776) (da38ad8), closes #12776
- fix(css): resolve at import from dependency basedir (#12796) (46bdf7d), closes #12796
- fix(worker): asset in iife worker and relative base (#12697) (ddefc06), closes #12697
- fix(worker): return null for shouldTransformCachedModule (#12797) (ea5f6fc), closes #12797
- fix: allow onwarn to override vite default warning handling (#12757) (f736930), closes #12757
- fix: ensure module in graph before transforming (#12774) (44ad321), closes #12774
- fix: update package cache watcher (#12772) (a78588f), closes #12772
- fix: avoid clean up while committing deps folder (#12722) (3f4d109), closes #12722
- fix: ignore pnp resolve error (#12719) (2d30ae5), closes #12719
- fix: leave fully dynamic import.meta.url asset (fixes #10306) (#10549) (56802b1), closes #10306 #10549
- fix: output combined sourcemap in importAnalysisBuild plugin (#12642) (d051639), closes #12642
- fix: take in relative assets path fixes from rollup (#12695) (81e44dd), closes #12695
- fix: throws error when plugin tries to resolve ID to external URL (#11731) (49674b5), closes #11731
- fix(css): css file emit synchronously (#12558) (8e30025), closes #12558
- fix(import-analysis): escape quotes correctly (#12688) (1638ebd), closes #12688
- fix(optimizer): load the correct lock file (#12700) (889eebe), closes #12700
- fix(server): delay ws server listen when restart (#12734) (abe9274), closes #12734
- fix(ssr): load sourcemaps alongside modules (#11780) (be95050), closes #11780
- fix(ssr): show ssr module loader error stack (#12651) (050c0f9), closes #12651
- fix(worker): disable manifest plugins in worker build (#12661) (20b8ef4), closes #12661
- fix(worker): worker import.meta.url should not depends on document in iife mode (#12629) (65f5ed2), closes #12629
- fix: avoid temporal optimize deps dirs (#12582) (ff92f2f), closes #12582
- fix: await
buildStart
before server start (#12647) (871d353), closes #12647 - fix: call
buildStart
only once when using next port (#12624) (e10c6bd), closes #12624 - fix: sourcemapIgnoreList for optimizedDeps (#12633) (c1d3fc9), closes #12633
- fix: splitFileAndPostfix works as cleanUrl (#12572) (276725f), closes #12572
- fix: throw error on build optimizeDeps issue (#12560) (02a46d7), closes #12560
- fix: use nearest pkg to resolved for moduleSideEffects (#12628) (1dfecc8), closes #12628
- fix(css): use
charset: 'utf8'
by default for css (#12565) (c20a064), closes #12565 - fix(html): dont pretransform public scripts (#12650) (4f0af3f), closes #12650
- fix: avoid crash because of no access permission (#12552) (eea1682), closes #12552
- fix: esbuild complains with extra fields (#12516) (7be0ba5), closes #12516
- fix: escape replacements in clientInjections (#12486) (3765067), closes #12486
- fix: open browser reuse logic (#12535) (04d14af), closes #12535
- fix: prevent error on not set location href (#12494) (2fb8527), closes #12494
- fix: simplify prettyUrl (#12488) (ebe5aa5), closes #12488
- fix(config): add random number to temp transpiled file (#12150) (2b2ba61), closes #12150
- fix(deps): update all non-major dependencies (#12389) (3e60b77), closes #12389
- fix(html): public asset urls always being treated as paths (fix #11857) (#11870) (46d1352), closes #11857 #11870
- fix(ssr): hoist import statements to the top (#12274) (33baff5), closes #12274
- fix(ssr): hoist re-exports with imports (#12530) (45549e4), closes #12530
- fix: should generate Hi-res sourcemap for dev (#12501) (1502617), closes #12501
Clean up
- refactor: simplify crawlEndFinder (#12868) (31f8b51), closes #12868
- refactor: use simpler resolve for nested optimized deps (#12770) (d202588), closes #12770
- refactor:
import.meta.url
condition from renderChunk hook of worker plugin (#12696) (fdef8fd), closes #12696 - refactor: clean up preTransformRequest (#12672) (561227c), closes #12672
- refactor: make debugger nullable (#12687) (89e4977), closes #12687
- refactor: remove
ensureVolumeInPath
(#12690) (a3150ee), closes #12690 - refactor: remove unused exports data props (#12740) (4538bfe), closes #12740
- refactor: use
resolvePackageData
inrequireResolveFromRootWithFallback
(#12712) (1ea38e2), closes #12712 - refactor(css): simplify cached import code (#12730) (0646754), closes #12730
- refactor: improve scanner logs (#12578) (9925a72), closes #12578
- refactor: isInNodeModules util (#12588) (fb3245a), closes #12588
- refactor: remove
idToPkgMap
(#12564) (a326ec8), closes #12564 - refactor: simplify lookupFile (#12585) (4215e22), closes #12585
- refactor: tryStatSync as util (#12575) (92601db), closes #12575
- refactor: use findNearestPackageData in more places (#12577) (35faae9), closes #12577
- refactor: esbuild plugin config logic (#12493) (45b5b0f), closes #12493
Previous Changelogs
4.3.0-beta.8 (2023-04-19)
4.3.0-beta.7 (2023-04-17)
4.3.0-beta.6 (2023-04-14)
4.3.0-beta.5 (2023-04-11)
4.3.0-beta.4 (2023-04-09)
4.3.0-beta.3 (2023-04-07)
4.3.0-beta.2 (2023-04-05)
4.3.0-beta.1 (2023-03-29)
4.3.0-beta.0 (2023-03-23)
v4.2.3
Please refer to CHANGELOG.md for details.
v4.2.2
v4.2.1
- fix: add
virtual:
to virtual module source map ignore (#12444) (c4aa28f), closes #12444 - fix(css): inject source content conditionally (#12449) (3e665f6), closes #12449
- fix(worker): using data URLs for inline shared worker (#12014) (79a5007), closes #12014
- chore: changelog edits for 4.2 (#12438) (ce047e3), closes #12438
v4.2.0
Vite 4.2 is out!
Support env variables replacement in HTML files
Vite now supports replacing env variables in HTML files. Any properties in import.meta.env
can be used in HTML files with a special %ENV_NAME%
syntax:
<h1>Vite is running in %MODE%</h1>
<p>Using data from %VITE_API_URL%</p>
Sourcemaps improvements
The Chrome Dev Tools team has been working to improve the DX of Vite and Vite-powered frameworks in the dev tools. Vite 4.2 brings an improved experience and tools for framework authors to hide 3rd party code and build artifacts from the user from console log traces using server.sourcemapIgnoreList
and build.rollupOptions.output.sourcemapIgnoreList
.
ESM subpath imports
Vite 4.2 now supports subpath imports, thanks to @lukeed05's resolve.exports library.
TypeScript 5 support
Vite 4.2 also supports TypeScript 5's tsconfig
extends
array format, thanks to tsconfck.
esbuild 0.17
esbuild v0.17.0 improved the design of its incremental, watch, and serve APIs. Check out #11908 for the rationale of why we didn't consider the backward-incompatible changes breaking for our use cases. The updated esbuild design now allows Vite to properly cancel in-fly builds and improve server restarts.
Use Rollup types from the vite package
Expose Rollup types as a namespace. This is helpful to avoid type conflicts because of different versions of Rollup types in environments like vite-ecosystem-ci (#12316).
import type { Rollup } from 'vite'
Português Docs Translation
The Vite documentation is now translated to Português at pt.vite.dev thanks to Nazaré Da Piedade .
Features
- feat: add status message for 504 caused by optimizer (#12435) (5cdd3fa), closes #12435
- feat: update tsconfck to 2.1.0 to add support for typescript 5 config syntax (#12401) (3f1c379), closes #12401
- feat: default esbuild jsxDev based on config.isProduction (#12386) (f24c2b0), closes #12386
- feat(css): add
build.cssMinify
(#12207) (90431f2), closes #12207 - feat(types): export Rollup namespace (#12316) (6e49e52), closes #12316
- feat: add
sourcemapIgnoreList
configuration option (#12174) (f875580), closes #12174 - feat: cancellable scan during optimization (#12225) (1e1cd3b), closes #12225
- feat: don't override
build.target
if terser is 5.16.0+ (#12197) (9885f6f), closes #12197 - feat: support ESM subpath imports (#7770) (cc92da9), closes #7770
- feat(css): add preprocessor option to define stylus vars & funcs (#7227) (5968bec), closes #7227
- feat(css): support resolving stylesheets from exports map (#7817) (108aadf), closes #7817
- feat(html): support env replacement (#12202) (4f2c49f), closes #12202
- refactor: customize ErrorOverlay (part 2) (#11830) (4159e6f), closes #11830
- refactor: remove constructed sheet type style injection (#11818) (1a6a0c2), closes #11818
- refactor(importAnalysis): cache injected env string (#12154) (2aad552), closes #12154
- feat: esbuild 0.17 (#11908) (9d42f06), closes #11908
- feat: ignore list client injected sources (#12170) (8a98aef), closes #12170
- feat: support rollup plugin
this.load
in plugin container context (#11469) (abfa804), closes #11469 - feat(cli): allow to specify sourcemap mode via --sourcemap build's option (#11505) (ee3b90a), closes #11505
- feat(reporter): report built time (#12100) (f2ad222), closes #12100
Bug Fixes
- fix: html env replacement plugin position (#12404) (96f36a9), closes #12404
- fix(optimizer): # symbol in deps id stripped by browser (#12415) (e23f690), closes #12415
- fix(resolve): rebase sub imports relative path (#12373) (fe1d61a), closes #12373
- fix(server): should close server after create new server (#12379) (d23605d), closes #12379
- fix(resolve): remove deep import syntax handling (#12381) (42e0d6a), closes #12381
- fix: print urls when dns order change (#12261) (e57cacf), closes #12261
- fix: throw ssr import error directly (fix #12322) (#12324) (21ffc6a), closes #12322 #12324
- fix(config): watch config even outside of root (#12321) (7e2fff7), closes #12321
- fix(config): watch envDir even outside of root (#12349) (131f3ee), closes #12349
- fix(define): correctly replace SSR in dev (#12204) (0f6de4d), closes #12204
- fix(optimizer): suppress esbuild cancel error (#12358) (86a24e4), closes #12358
- fix(optimizer): transform css require to import directly (#12343) (716286e), closes #12343
- fix(reporter): build.assetsDir should not impact output when in lib mode (#12108) (b12f457), closes #12108
- fix(types): avoid resolve.exports types for bundling (#12346) (6b40f03), closes #12346
- fix(worker): force rollup to build worker module under watch mode (#11919) (d464679), closes #11919
- fix: resolve browser mapping using bare imports (fix #11208) (#11219) (22de84f), closes #11208 #11219
- fix: avoid null sourcePath in
server.sourcemapIgnoreList
(#12251) (209c3bd), closes #12251 - fix: configure proxy before subscribing to error events (#12263) (c35e100), closes #12263
- fix: enforce absolute path for server.sourcemapIgnoreList (#12309) (ab6ae07), closes #12309
- fix: handle error without line and column in loc (#12312) (ce18eba), closes #12312
- fix: properly clean up optimization temp folder (#12237) (fbbf8fe), closes #12237
- fix: unique dep optimizer temp folders (#12252) (38ce81c), closes #12252
- fix(build-import-analysis): should not append ?used when css request has ?url or ?raw (#11910) (e3f725f), closes #11910
- fix(optimizer): don not call context.rebuild after cancel (#12264) (520d84e), closes #12264
- fix(resolve): update
resolve.exports
to2.0.1
to fix*
resolution issue (#12314) (523d6f7), closes #12314 - fix: use relative paths in
sources
for transformed source maps (#12079) (bcbc582), closes #12079 - fix(cli): after setting server.open, the default open is inconsistent… (#11974) (33a38db), closes #11974
- fix(client-inject): replace globalThis.process.env.NODE_ENV (fix #12185) (#12194) (2063648), closes #12185 #12194
- fix(css): should not rebase http url for less (fix: #12155) (#12195) (9cca30d), closes #12155 #12195
- fix(deps): update all non-major dependencies (#12036) (48150f2), closes #12036
- fix(import-analysis): improve error for jsx to not be preserve in tsconfig (#12018) (91fac1c), closes #12018
- fix(optimizer): log esbuild error when scanning deps (#11977) (20e6060), closes #11977
- fix(optimizer): log unoptimizable entries (#12138) (2c93e0b), closes #12138
- fix(server): watch env files creating and deleting (fix #12127) (#12129) (cc3724f), closes #12127 #12129
- build: correct d.ts output dir in development (#12212) (b90bc1f), closes #12212
Previous Changelogs
4.2.0-beta.2 (2023-03-13)
4.2.0-beta.1 (2023-03-07)
4.2.0-beta.0 (2023-02-27)
v4.1.5
Please refer to CHANGELOG.md for details.
Configuration
-
If you want to rebase/retry this MR, check this box
This MR has been generated by Renovate Bot.