Vite 8 and Rolldown: upgrade guide
- Authors
- Name
- Hamza Rahman
- Published on
- -10 mins read
This guide walks through upgrading a Vite 5, 6 or 7 project to Vite 8, with the config changes one React and TypeScript project needed and a way to check your plugins before you start.
Checked on December 4, 2026 against Vite 8.4.1 (which uses Rolldown ~1.3.4), Vite 7.3.8 and @vitejs/plugin-react 6.3.1, on Node v25.2.1.
What changed
Vite 8.0 came out on March 12, 2026. Vite 8.4 followed on November 26, and 8.4.1 on December 2. The bundling tools changed as follows:
| Job | Vite 7 | Vite 8 |
|---|---|---|
| Production bundling | Rollup | Rolldown |
| Dependency pre-bundling | esbuild | Rolldown |
| TypeScript and JSX transforms | esbuild | Oxc |
| JavaScript minification | esbuild | Oxc Minifier |
| CSS minification | esbuild | Lightning CSS |
Vite no longer depends on esbuild. It is an optional peer, needed only by fallbacks and plugins that still use it.
Before you start
- Check Node. Vite 8 needs
^20.19.0 || >=22.12.0, the same as Vite 7. Node 20 is past its end of life, so use 22.12 or newer. - On Vite 5, do the v5 to v6 steps and then the v6 to v7 steps first. Vite 7 dropped Node 18, the Sass legacy API and
splitVendorChunkPlugin. - Save a baseline build, so you can compare chunks later:
npx vite build
cp -r dist ../dist-vite7
For a large app, the migration guide suggests an intermediate step: replace vite with rolldown-vite ("vite": "npm:rolldown-vite@7.2.2" in package.json) while still on Vite 7. That separates bundler problems from the other Vite 8 changes.
The test project
The examples use an app scaffolded with create-vite 7.1.3 (the react-ts template) plus recharts, three, lodash, date-fns, highlight.js and React Router. These are the imports that shape its chunks:
// src/App.tsx
import { lazy, Suspense, useState } from 'react'
import _ from 'lodash'
import { format } from 'date-fns'
import hljs from 'highlight.js'
import { BrowserRouter, Route, Routes } from 'react-router'
const Chart = lazy(() => import('./Chart'))
// in a click handler: const { makeScene } = await import('./Scene')
// src/Chart.tsx
import { Bar, BarChart, XAxis } from 'recharts'
// src/Scene.ts: a Scene with one Mesh (BoxGeometry, MeshStandardMaterial)
import * as THREE from 'three'
The starting config uses common Vite 7 options, including the React Compiler through Babel:
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
export default defineConfig({
plugins: [react({ babel: { plugins: ['babel-plugin-react-compiler'] } })],
esbuild: { drop: ['console', 'debugger'] },
build: {
rollupOptions: {
output: {
manualChunks: {
react: ['react', 'react-dom'],
highlight: ['highlight.js'],
},
},
},
},
})
Upgrade Vite on its own first, and leave the config untouched:
npm install -D vite@8
npx vite build
@vitejs/plugin-react 5 still runs on Vite 8, so it can stay for this step. Before 5.2.0 its peer range stops at Vite 7, so npm prints an ERESOLVE overriding peer dependency warning. Version 5.2.0 added Vite 8 to the range.
Breakage 1: object manualChunks fails the build
Warning: Invalid output options (1 issue found)
- For the "manualChunks". Invalid type: Expected Function but received Object.
...
TypeError: manualChunks is not a function
The object form was removed, and the function form is deprecated. Use codeSplitting groups in the final config below. tsc -b also catches this if your tsconfig.node.json includes vite.config.ts.
Breakage 2: esbuild.drop does nothing
With manualChunks switched to a function, the build passes but prints this:
Both esbuild and oxc options were set. oxc options will be used
and esbuild options will be ignored. The following esbuild options
were set: `{ drop: [ 'console', 'debugger' ] }`
The console.log calls stay in the output, and the build still exits with code 0. Move the drop options to build.rolldownOptions.output.minify.compress, as the migration guide describes.
Vite converts many esbuild options to oxc for you, but not all of them, so read the build warnings.
Breakage 3: react({ babel }) is gone in plugin-react 6
@vitejs/plugin-react 6 uses Oxc for React Refresh and drops Babel. If you pass Babel plugins, move them to @rolldown/plugin-babel:
npm install -D @vitejs/plugin-react@6 @rolldown/plugin-babel @babel/core
The command leaves out babel-plugin-react-compiler because the test project already has it. Add it if you're setting up the React Compiler for the first time.
If you don't use Babel plugins, install only @vitejs/plugin-react@6. react() is all you need, with no extra packages.
The working Vite 8 config
import { defineConfig } from 'vite'
import react, { reactCompilerPreset } from '@vitejs/plugin-react'
import babel from '@rolldown/plugin-babel'
export default defineConfig({
plugins: [react(), babel({ presets: [reactCompilerPreset()] })],
build: {
rolldownOptions: {
output: {
minify: { compress: { dropConsole: true, dropDebugger: true } },
codeSplitting: {
groups: [
{ name: 'react', test: /node_modules[\\/](react|react-dom|scheduler)[\\/]/ },
{ name: 'highlight', test: /node_modules[\\/]highlight\.js[\\/]/ },
],
},
},
},
},
})
With this config, tsc -b and vite build pass, the console.log is gone from the bundle, and the dev server's output for a component contains the React Compiler runtime import. The app also loads in headless Chromium from both vite preview and the dev server, without console errors. Only the config and package.json change.
plugin-react 6.1 also added an experimental native React Compiler through oxc-transform-react, which isn't tested here.
Build times
This compares the Vite 7.3.8 project with the upgraded one. Each runs this command in its own directory, with vite.config.ts for the first pair and a config containing only plugins: [react()] for the second:
node node_modules/vite/bin/vite.js build -c vite.config.ts
These numbers come from one Linux machine (11th Gen Intel i5-1145G7, 8 threads, 15 GB RAM, Node v25.2.1). Each setup got one unmeasured warm-up, then 10 interleaved runs, timed as wall-clock time around the process.
| Config | Vite 7.3.8 median (min to max) | Vite 8.4.1 median (min to max) |
|---|---|---|
| With React Compiler, as above | 13.13s (11.39 to 14.59s) | 3.11s (2.46 to 4.21s) |
Only react() | 12.67s (9.67 to 13.63s) | 2.27s (1.98 to 2.98s) |
Other work was running on the machine during the run (1-minute load average 11.8 at the start and 20.3 at the end), so an idle machine would give lower absolute times. On these medians the build is about 4 times faster with the React Compiler config and about 5.6 times faster with only react().
Both rows include the plugin change from 5.0.4 to 6.3.1. The first row also includes the config changes, with Babel still running for the React Compiler, so it measures the whole upgrade and not Rolldown alone.
The chunks change too. The highlight chunk went from 978.60 kB to 919.33 kB, while the lazy three.js chunk grew from 129.09 kB to 144.43 kB (minified, before gzip). The react group grew from 11.85 kB to 218.14 kB because the regular expression catches all of react-dom, while the old object form left most of it in the entry chunk. Compare your own chunks instead of assuming they shrink.
The Vite team reports results such as 46s to 6s at Linear, measured during the rolldown-vite preview and beta phases. It also warns that Vite 8 is about 15 MB larger to install.
Renamed, removed and no-op options
| Old | Vite 8 |
|---|---|
build.rollupOptions | build.rolldownOptions (old name deprecated) |
worker.rollupOptions | worker.rolldownOptions (old name deprecated) |
optimizeDeps.esbuildOptions | optimizeDeps.rolldownOptions (converted for now) |
esbuild | oxc (partly converted for now) |
esbuild.drop | output.minify.compress.dropConsole and dropDebugger |
output.manualChunks object | removed, use output.codeSplitting |
output.manualChunks function | deprecated |
build.commonjsOptions | no-op |
build.minify: 'esbuild' | deprecated, install esbuild yourself |
resolve.alias[].customResolver | a resolveId plugin with enforce: 'pre' |
transformWithEsbuild | transformWithOxc |
Other breakages to test for
The official migration guide lists these. They didn't come up in the test project, but check for them in yours.
- CommonJS default imports. Interop is now the same in dev and build. An import that worked may now need
.default, or stop needing it.legacy.inconsistentCjsInterop: truerestores the old behavior for a while. - Browser targets. The default rose to Chrome 111, Edge 111, Firefox 114 and Safari 16.4. Set
build.targetif you support older versions. - Native decorators. Oxc does not lower them. The guide shows Babel and SWC workarounds.
- Externalized
requirecalls. They stay asrequire. UseesmExternalRequirePluginif you need imports. browserandmodulefields. Vite no longer inspects file contents to choose between them. It followsresolve.mainFields.- UMD and IIFE output.
import.meta.urlbecomesundefined. - Output formats.
systemandamdare not supported. - plugin-legacy. Transforming to ES5 and below is not supported.
- CSS. Lightning CSS minifies now, so compare your rendered CSS. Set
build.cssMinify: 'esbuild'with esbuild installed to go back.
Check plugin compatibility
Start with the declared peer ranges:
npm view @vitejs/plugin-react-swc peerDependencies.vite
# ^4 || ^5 || ^6 || ^7 || ^8
npm ls vite
npm explain esbuild # an error here means nothing depends on it
The Vite plugin registry lists published plugins. A matching range is a claim, not a test, so also search each plugin's source for the risky APIs:
grep -rnE "transformWithEsbuild|shouldTransformCachedModule|resolveImportMeta|renderDynamicImport|moduleParsed" node_modules/YOUR_PLUGIN/
Those hooks are either unsupported by Rolldown or, for moduleParsed, outside what the plugin guide says will work in dev. transformWithEsbuild is deprecated and needs esbuild installed.
If you write plugins, check three more things:
- A
loadortransformhook that turns another file type into JavaScript may needmoduleType: 'js'in its return value. - Parallel Rollup hooks run sequentially in Rolldown.
bundle[name] = valueis not supported, so usethis.emitFile(). - Rolldown validates sourcemaps more strictly. An invalid map that Rollup accepted can fail the build.
Notable in 8.1 to 8.4
- 8.1: experimental bundled dev mode and chunk import maps, plus Wasm ESM imports.
- 8.2: a new top-level
inputoption. - 8.3: a top-level
tsconfigoption, and Rolldown watch options inserver.watch. - 8.4:
server.fs.strict: 'extended', duplicate dev server detection, and CSS refetching for dynamic imports that failed once (in browsers that retry failed imports).
Two 8.4 details matter during an upgrade. Starting a second dev server for the same project with similar options now exits with an error, unless you pass --bypass-lock. And if you turn on server.fs.strict: 'extended' with React, use plugin-react 6.3.1 or newer, which fixed HMR for it.
Upgrade checklist
- Reach Vite 7 with a clean build.
- Check plugin peer ranges and run the search above.
- Install
vite@8alone, then build and read every warning. - Replace
manualChunks,esbuildandrollupOptions. - Upgrade plugin-react to 6, and move Babel plugins if you have any.
- Run
npm ls vite,tsc -b, your tests,vite buildandvite preview. - Compare chunk sizes, and search the output for code you expected to drop.
What you built
You now have a Vite 8 project on Rolldown, with no deprecated config left and a chunk comparison against the old build. If tsc is now the slow part of npm run build, see the TypeScript 7 migration guide.
References
Related articles
What an AI coding model costs per solved task
Turn per-million-token prices into cost per attempt and cost per solved task with small JavaScript functions, including caching, retries and review time.
Build your own coding-agent benchmark in Node.js
Build a small coding-agent benchmark in Node.js with disposable git worktrees, hidden verifiers, time limits, repeated runs and Wilson intervals.
TypeScript 7 migration: the native Go compiler
Move a project to TypeScript 7: install the native compiler, fix tsconfig errors, keep TypeScript 6 for tools that need its API, and run both in CI.

