Migration from v6
Node.js Support
Vite no longer supports Node.js 18, which reached its EOL. Node.js 20.19+ / 22.12+ is now required.
Default Browser Target change
The default browser value of build.target is updated to a newer browser.
- Chrome 87 → 107
- Edge 88 → 107
- Firefox 78 → 104
- Safari 14.0 → 16.0
These browser versions align with Baseline Widely Available feature sets as of 2025-05-01. In other words, they were all released before 2022-11-01.
In Vite 5, the default target was named 'modules', but this is no longer available. Instead, a new default target 'baseline-widely-available' is introduced.
General Changes
Removed Sass legacy API support
As planned, support for the Sass legacy API is removed. Vite now only supports the modern API. You can remove the css.preprocessorOptions.sass.api / css.preprocessorOptions.scss.api option.
Removed deprecated features
splitVendorChunkPlugin(deprecated in v5.2.7)- This plugin was originally provided to ease migration to Vite v2.9.
- The
build.rollupOptions.output.manualChunksoption can be used to control the chunking behavior if needed.
- Hook-level
enforce/transformfortransformIndexHtml(deprecated in v4.0.0)- It was changed to align the interface with Rollup's object hooks.
ordershould be used instead ofenforce, andhandlershould be used instead oftransform.
Advanced
There are other breaking changes which only affect few users.
- [#19979] chore: declare version range for peer dependencies
- Specified the peer dependencies version range for CSS preprocessors.
- [#20013] refactor: remove no-op
legacy.proxySsrExternalModuleslegacy.proxySsrExternalModulesproperty had no effect since Vite 6. It is now removed.
- [#19985] refactor!: remove deprecated no-op type only properties
- The following unused properties are now removed:
ModuleRunnerOptions.root,ViteDevServer._importGlobMap,ResolvePluginOptions.isFromTsImporter,ResolvePluginOptions.getDepsOptimizer,ResolvePluginOptions.shouldExternalize,ResolvePluginOptions.ssrConfig
- The following unused properties are now removed:
- [#19986] refactor: remove deprecated env api properties
- These properties were deprecated from the beginning. It is now removed.
- [#19987] refactor!: remove deprecated
HotBroadcasterrelated types- These types were introduced as part of the now-deprecated Runtime API. It is now removed:
HMRBroadcaster,HMRBroadcasterClient,ServerHMRChannel,HMRChannel
- These types were introduced as part of the now-deprecated Runtime API. It is now removed:
- [#19996] fix(ssr)!: don't access
Objectvariable in ssr transformed code__vite_ssr_exportName__is now required for the module runner runtime context.
- [#20045] fix: treat all
optimizeDeps.entriesvalues as globsoptimizeDeps.entriesnow does not receive literal string paths. Instead, it always receives globs.
- [#20222] feat: apply some middlewares before
configureServerhook, [#20224] feat: apply some middlewares beforeconfigurePreviewServerhook- Some middlewares are now applied before the
configureServer/configurePreviewServerhook. Note that if you don't expect a certain route to apply theserver.cors/preview.corsoption, make sure to remove the related headers from the response.
- Some middlewares are now applied before the
Migration from v5
Check the Migration from v5 Guide in the Vite v6 docs first to see the needed changes to port your app to Vite 6, and then proceed with the changes on this page.