Upgrading @vitejs/plugin-react 5 to 6
Breaking5.2.0 → 6.1.2Breaking2Platform1New1Changed1Fixed7
BreakingUpgrade verdict
2 breaking changes and a platform requirement change.
In plain terms
- The plugin no longer bundles Babel or its options. If you relied on Babel plugins, add the separate @rolldown/plugin-babel plugin instead.
- This version only works with Vite 8 and later. If you are on Vite 7, upgrade Vite first.
- The package now accepts a wider range of versions of a related Babel plugin, so installs with the newer 0.2.x release no longer conflict.
Must act 3 items need code or config changes
Drops @babel/core, @babel/plugin-transform-react-jsx-self, @babel/plugin-transform-react-jsx-source, @types/babel__core, react-refresh.
Installs 1 package in all (was 48).
What you must change
Breaking2
Removes Babel-related features and drops babel as a dependency since Vite 8+ handles React Refresh Transform via Oxc.
babel@rolldown/plugin-babelreactCompilerPresetDrops support for Vite 7 and below; Vite 8 or newer is now required.
Platform1
Expands the
@rolldown/plugin-babel peer dependency range to include ^0.2.0.@rolldown/plugin-babelAPI changes
Generated by DepDelta from published .d.ts files. Not mixed with prose notes.
- removed:
interface ReactBabelOptions extends BabelOptions - removed:
property Options.babel?: BabelOptions | ((id: string, options: { ssr?: boolean }) => BabelOptions) - removed:
property ReactBabelOptions.overrides: Extract<BabelOptions['overrides'], any[]> - removed:
property ReactBabelOptions.parserOpts: ParserOptions & { plugins: Extract<ParserOptions['plugins'], any[]> } - removed:
property ReactBabelOptions.plugins: Extract<BabelOptions['plugins'], any[]> - removed:
property ReactBabelOptions.presets: Extract<BabelOptions['presets'], any[]> - removed:
type BabelOptions = Omit<TransformOptions, 'ast' | 'filename' | 'root' | 'sourceFileName' | 'sourceMaps' | 'inputSourceMap'> - removed:
type ViteReactPluginApi = { reactBabel?: ReactBabelHook } - added:
const reactCompilerPreset: (options?: ReactCompilerBabelPluginOptions) => RolldownBabelPreset - added:
interface ReactCompilerOptions extends ReactCompilerOptions - added:
property Options.compiler?: boolean | ReactCompilerPluginOptions - added:
property ReactCompilerOptions.logDiagnostics?: boolean
- added:
type ReactCompilerBabelPluginOptions = babelPluginReactCompiler.PluginOptions - added:
type ReactCompilerOptions = oxcTransformReact.ReactCompilerOptions - added:
type RolldownBabelPreset = pluginBabel.RolldownBabelPreset