vitejs/vite v7.0.0 → v6.4.2

This range is a broad Vite update spanning late v7, the v8 major, and backports into v6.4.x. The visible work centers on dev-server ergonomics, SSR and optimizer correctness, create-vite template updates, and a few security and edge-case fixes.

What's new

  • Vite now supports vite:client-connect and vite:client-disconnect events, which lets tools track the dev client lifecycle directly. This is aimed at cases like full bundle mode HMR and integrations migrating to environment.hot, where knowing when clients attach or detach matters. (#20978)

  • The dev server can forward browser console output and unhandled runtime errors to the terminal with server.forwardConsole. You can enable it as true for error and warning forwarding, or use the object form to control unhandledErrors and logLevels; it also turns on by default under supported coding-agent environments. (#20916)

  • .wasm?init now works in SSR as well as the browser. Server-side consumers get helper code that loads WebAssembly in an SSR-friendly way instead of relying on relative fetch, which previously led to failures like ERR_INVALID_URL in SSR and Vitest setups. (#21102)

  • Vite can now serve over HTTP/2 even when server.proxy is enabled. That removes a long-standing limitation where using proxying with HTTPS forced a downgrade away from HTTP/2. (#20869)

  • Dependency optimization gives clearer feedback when it is slow. If scanning or bundling takes more than one second, Vite logs progress lines such as [optimizer] scanning dependencies..., so large apps no longer look stuck after the initial “ready” message. (#21797)

  • Manifest generation now includes an assets field for standalone CSS entry points. That fills in data backend integrations need to emit preload and stylesheet links even when a CSS entry is not pulled in through a JavaScript entry. (#21015)

  • Library mode with Terser now keeps pure annotations for ES output while still minifying. This avoids having to disable Terser entirely just to preserve tree-shaking hints. (#20522)

  • create-vite adds an “install and start now” flow. You can use -i, --immediate to install dependencies and start the dev server right after scaffolding, and choose a package manager interactively or via flags like --agent npm. (#20468)

  • create-vite also refreshes the starter experience: template branding was updated for the new theme, TypeScript templates now include Node typings and types compiler options, React templates support React Compiler, and the CLI shows clearer links and descriptions for Vite-based framework variants. (#21425, #21403, #18642, #20132, #20704)

  • Vite now accepts a resolved config when calling createServer, which helps tooling that needs to reuse an already-resolved configuration object instead of resolving it again. (#20932)

  • URL detection from HTTPS certificates now supports multiple certificates instead of only one. That makes automatic server URL hostname resolution work with TLS setups that provide certificate arrays. (#20707)

Fixes

  • Fixed AMD bundle output so relative imports are resolved relative to the current module instead of document.baseURI, which broke plugin-style AMD deployments loaded by RequireJS. (#20861)

  • Fixed optimized dependencies that use new URL('./worker.js', import.meta.url) so relative worker and asset paths still point at the correct files after bundling into .vite/deps. (#21434)

  • Fixed a dev-server regression where document requests could return JavaScript source files instead of index.html when the URL matched a project filename. (#20866)

  • Fixed alias resolution in dev mode for aliases that start with URL-like patterns such as //, bringing behavior back in line with vite build. (#20760)

  • Fixed imports being rewritten by stripping the configured base from file-path-like imports, which could corrupt absolute filesystem imports. (#21221)

  • Fixed .env loading for mounted FIFO files, so secrets streamed through named pipes can be read without requiring a regular file on disk. (#21365)

  • Fixed worker builds where prepareOutDirPlugin could remove output directories during worker bundling and leave files missing. (#20556)

  • Fixed SSR builds with emitAssets: true when sharedConfigBuild: true is also enabled. (#20787)

  • Fixed ModuleRunnerImportMeta typing conflicts when projects use skipLibCheck: false alongside libraries that augment ImportMeta, such as @types/node, Expo, or React Native. (#21710)

  • Fixed non-ASCII characters in base64 sourcemaps in the module runner, which previously decoded incorrectly. (#21985)

  • Fixed non-interactive stdin handling so the server drains stdin properly instead of waiting forever for end. (#20837)

  • Fixed create-vite dependency installation issues in the scaffolding flow. (#20826)

Other notable changes

  • resolve.alias.customResolver is now deprecated. The recommended replacement is a plugin with a resolveId hook. (#21476)
  • Vite warns when envPrefix contains only spaces, treating that configuration as effectively empty. (#21292)
  • esbuild was updated to ^0.27.0. (#21183)
  • Vite replaced debug with obug internally for modern ESM and typed debugging support. (#21107)
  • Experimental Vite DevTools integration landed in core. (#21331)
  • A highly experimental full bundle mode was added for ongoing development work, but it is not expected to be used yet. (#21235)
  • Security-related fixes include applying fs.strict checks to HTML files and upgrading sirv to 3.0.2. (#20736, #20735)

Contributors

@TheAlexLichter, @dschmidt, @upsuper, @brillout, @sapphi-red, @WhiteKiwi, @Copilot, @hi-ogawa, @HunterLarco, @BLUE-YBZ, @gameroman, @webfansplz, @Corvince, @guyco3, @btea, @smeng9, @sxzz, @adamkoppede, @YevheniiKotyrlo, @o-m12a, @sidharth-sudhir, @dependabot[bot], @sheremet-va, @monam2, @ArnaudBarre, @nicolo-ribaudo, @illusionaries, @thatguystone

Only a subset of merged work was included here.

Only the most active 50 of 633 merged PRs were included. See the full compare view.