Packages

vite

8.3.8 · 11 Nov 2026MIT286.5M / weekRepositoryHomepagenpmAtom feed

Your version

6.0.0

major26 Nov 2024Where it was published

6.4.6 is the newest release of 6.x.

Summary· from the note as AI read it

Security fixUpgrade: this release fixes a security issue.

Before you upgrade

  • Check .env variable expansion behaviour with dotenv-expand v12
  • Custom resolve.conditions no longer include defaults; add defaultClientConditions explicitly
  • More HTML asset sources are now processed; check build output
  • Remove the server.fs.cachedChecks option from config
  • Proxy bypass is now called for WebSocket requests; check bypass functions
  • Use ?inline instead of default-importing CSS in SSR dev
  • Library CSS output file is named after package; update references or set build.lib.cssFileName
  • chokidar v4 drops glob support in watch options; update server.watch config

New minimums

  • Node 21 is no longer supported; use Node 18, 20 or 22+

Security

  • Upgrade to get rollup 4.22.4+ fixing an XSS issue
  • Upgrade to fix DOM Clobbering XSS gadget in built output

New

  • add support for .cur type
  • enable HMR by default on ModuleRunner side
  • support module-sync condition when loading config if enabled
  • add isSsrTargetWebWorker flag to configEnvironment hook
  • add ssr.resolve.mainFields option

Migration Guide ↗

In short

18 breaking4 removed2 security26 new7 faster98 fixed62 internal

  • Breaking

    deps: update dependency dotenv-expand to v12

  • Breaking

    resolve: allow removing conditions

  • Breaking

    html: support more asset sources

  • Breaking

    proxy bypass with WebSocket

  • Breaking

    lib: use package name for css output file name

  • Breaking

    update to chokidar v4

  • Breaking

    support file:// resolution

  • Breaking

    deps: update postcss-load-config to v6

Security

18 advisories affect 6.0.0; 6.4.4 fixes them

13 more

Release note

The section about vite of a note shared by several packages.

Vite 6 is out!

Today, we're taking another big step in Vite's story. The Vite team, contributors, and ecosystem partners are excited to announce the release of the next Vite major:

We want to thank the more than 1K contributors to Vite Core and the maintainers and contributors of Vite plugins, integrations, tools, and translations that have helped us craft this new major. We invite you to get involved and help us improve Vite for the whole ecosystem. Learn more at our Contributing Guide.

Breaking changes

  • Breaking

    Drop node 21 support in version ranges

  • Breaking

    deps: update dependency dotenv-expand to v12

  • Breaking

    resolve: allow removing conditions

  • Breaking

    html: support more asset sources

  • Breaking

    Remove fs.cachedChecks option

  • Breaking

    Proxy bypass with WebSocket

  • Breaking

    css: remove default import in ssr dev

  • Breaking

    lib: use package name for css output file name

  • Breaking

    Update to chokidar v4

  • Breaking

    Support file:// resolution

  • Breaking

    deps: update postcss-load-config to v6

  • Breaking

    css: change default sass api to modern/modern-compiler

  • Breaking

    css: load postcss config within workspace root only

  • Breaking

    Default build.cssMinify to 'esbuild' for SSR

  • Breaking

    json: add json.stringify: 'auto' and make that the default

  • Breaking

    Bump minimal terser version to 5.16.0

  • Breaking

    deps: migrate fast-glob to tinyglobby

Features

  • Add support for .cur type

  • Removed

    Drop node 21 support in version ranges

  • Enable HMR by default on ModuleRunner side

  • Support module-sync condition when loading config if enabled

  • Add isSsrTargetWebWorker flag to configEnvironment hook

  • Add ssr.resolve.mainFields option

  • Expose default mainFields/conditions

  • Extended applyToEnvironment and perEnvironmentPlugin

  • optimizer: allow users to specify their esbuild platform option

  • Show error when accessing variables not exposed in CJS build

  • asset: add ?inline and ?no-inline queries to control inlining

  • asset: inline svg in dev if within limit

  • Use a single transport for fetchModule and HMR support

  • html: support more asset sources

  • resolve: allow removing conditions

  • html: support vite-ignore attribute to opt-out of processing

  • lib: use package name for css output file name

  • Log complete config in debug mode

  • Proxy bypass with WebSocket

  • Support file:// resolution

  • Update to chokidar v4

  • Allow custom console in createLogger

  • css: add more stricter typing of lightningcss

  • css: change default sass api to modern/modern-compiler

  • Read sec-fetch-dest header to detect JS in transform

  • css: load postcss config within workspace root only

  • json: add json.stringify: 'auto' and make that the default

  • Add .git to deny list by default

  • Add environment::listen

  • Enable dependencies discovery and pre-bundling in ssr environments

  • Restrict characters useable for environment name

  • Support arbitrary module namespace identifier imports from cjs deps

  • Introduce RunnableDevEnvironment

  • Support this.environment in options and onLog hook

  • css: support es2023 build target for lightningcss

  • Environment API

  • Expose EnvironmentOptions type

Bug Fixes

  • createRunnableDevEnvironment returns RunnableDevEnvironment, not DevEnvironment

  • getModulesByFile should return a serverModule

  • Catch error in full reload handler

  • client: overlay not appearing when multiple vite clients were loaded

  • deps: update all non-major dependencies

  • Display pre-transform error details

  • Exit code on SIGTERM

  • Expose missing InterceptorOptions type

  • html: fix inline proxy modules invalidation

  • Log error when send in module runner failed

  • module-runner: make evaluator optional

  • optimizer: detect npm / yarn / pnpm dependency changes correctly

  • optimizer: trigger onCrawlEnd after manual included deps are registered

  • optimizer: workaround firefox's false warning for no sources source map

  • ssr: replace __vite_ssr_identity__ with (0, ...) and inject ; between statements

  • Cjs build for perEnvironmentState et al

  • html: externalize rollup.external scripts correctly

  • Include more modules to prefix-only module list

  • ssr: format ssrTransform parse error

  • ssr: preserve fetchModule error details

  • Browser field should not be included by default for consumer: 'server'

  • client: detect ws close correctly

  • resolve: run ensureVersionQuery for SSR

  • Use server.perEnvironmentStartEndDuringDev

  • Allow nested dependency selector to be used for optimizeDeps.include for SSR

  • Asset new URL(,import.meta.url) match

  • Close watcher if it's disabled

  • config: write temporary vite config to node_modules

  • css: cssCodeSplit uses the current environment configuration

  • json: don't json.stringify arrays

  • less: prevent rebasing [@import](https://github.com/import) url(...)

  • lib: only resolve css bundle name if have styles

  • scss: improve error logs

  • define in environment config was not working

  • build: apply resolve.external/noExternal to server environments

  • config: remove error if require resolve to esm

  • Consider URLs with any protocol to be external

  • css: remove default import in ssr dev

  • Use picomatch to align with tinyglobby

  • css: cssCodeSplit in environments.xxx.build is invalid

  • css: make sass types work with sass-embedded

  • deps: update all non-major dependencies

  • Handle warmup glob hang

  • manifest: non entry CSS chunk src was wrong

  • module-runner: delay function eval until module runner instantiation

  • plugins: noop if config hook returns same config reference

  • Return the same instance of ModuleNode for the same EnvironmentModuleNode

  • Set scripts imported by HTML moduleSideEffects=true

  • Use websocket to test server liveness before client reload

  • Add typing to CSSOptions.preprocessorOptions

  • Default build.cssMinify to 'esbuild' for SSR

  • dev: prevent double URL encoding in server.open on macOS

  • preview: set resolvedUrls null after close

  • ssr: inject identity function at the top

  • ssr: preserve source maps for hoisted imports (fix #16355)

  • Augment hash for CSS files to prevent chromium erroring by loading previous files

  • cli: --watch should not override build.watch options

  • css: don't transform sass function calls with namespace

  • deps: update open dependency to 10.1.0

  • deps: update all non-major dependencies

  • More robust plugin.sharedDuringBuild

  • ssr: this in exported function should be undefined

  • worker: rewrite rollup output.format with worker.format on worker build error

  • injectQuery double encoding

  • Add position to import analysis resolve exception

  • assets: make srcset parsing HTML spec compliant

  • css: dont remove JS chunk for pure CSS chunk when the export is used

  • deps: bump tsconfck

  • deps: update all non-major dependencies

  • Destroy the runner when runnable environment is closed

  • Handle yarn command fail when root does not exist

  • hmr: don't try to rewrite imports for direct CSS soft invalidation

  • Make it easier to configure environment runner

  • middleware-mode: call all hot.listen when server restart

  • optimizer: don't externalize transitive dep package name with asset extension

  • resolve: fix resolve cache key for external conditions

  • resolve: fix resolve cache to consider conditions and more

  • types: add more overload to defineConfig

  • Asset import should skip handling data URIs

  • Cache the runnable environment module runner

  • Call this.hot.close for non-ws HotChannel

  • Close HotChannel on environment close

  • config: treat all files as ESM on deno

  • css: ensure sass compiler initialized only once

  • css: fix lightningcss dep url resolution with custom root

  • css: fix missing source file warning with sass modern api custom importer

  • data-uri: only match ids starting with data:

  • deps: update all non-major dependencies

  • Security

    deps: upgrade rollup 4.22.4+ to ensure avoiding XSS

  • html: make build-html plugin work with sharedPlugins

  • mixedModuleGraph: handle undefined id in getModulesByFile

  • optimizer: re-optimize when changing config webCompatible

  • Require serialization for HMRConnection.send on implementation side

  • ssr: fix source map remapping with multiple sources

  • Use config.consumer instead of options?.ssr / config.build.ssr

  • vite: refactor "module cache" to "evaluated modules", pass down module to "runInlinedModule"

  • Avoid DOM Clobbering gadget in getRelativeUrlFromDocument

  • Fs raw query

  • preload: throw error preloading module as well

  • Allow scanning exports from script module in svelte

  • build: declare preload-helper has no side effects

  • css: fallback to mainthread if logger or pkgImporter option is set for sass

  • dynamicImportVars: correct glob pattern for paths with parentheses

  • Ensure req.url matches moduleByEtag URL to avoid incorrect 304

  • html: escape html attribute

  • Incorrect environment consumer option resolution

  • preload: allow ignoring dep errors

  • Store backwards compatible ssrModule and ssrError

Performance Improvements

  • Reduce bundle size for Object.keys(import.meta.glob(...)) / Object.values(import.meta.glob(...))

  • worker: inline worker without base64

  • Remove strip-ansi for a node built-in

  • css: skip style.css extraction if code-split css

  • Call module.enableCompileCache()

  • Use crypto.hash when available

Reverts

  • Use chokidar v3

Code Refactoring

  • Removed

    Remove fs.cachedChecks option

A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.