All articles

Front-end13 min read

Vite 8 vs Vite 7 with Rolldown: I benchmarked my build

I benchmarked my site's build and dev server on Vite 7 and on Vite 8 with Rolldown: what got faster, what didn't change, and the new warnings that showed up.

Also in Português, Español, Français

Vite 8 came out in March 2026 with a big change under the hood: Rolldown, a bundler written in Rust, replacing esbuild and Rollup. The announcement talks about 10 to 30 times faster builds.

This site, the blog you're reading, was born on Vite 8. So I never had a "migration day" to write about. To cover it with real numbers, I went the other way: I copied the site, downgraded it to Vite 7 and measured both side by side.

Spoiler: the bundler got a lot faster. My build, barely.

TL;DR#

  • What changed: Vite 7 used esbuild in dev and Rollup in the build. Vite 8 uses Rolldown for both, with Oxc transforming and minifying the JS and Lightning CSS minifying the CSS.
  • On my site, the client build got 1.8x faster: 2.47 s on Vite 7 versus 1.35 s on Vite 8. Far from the announcement's 10 to 30 times, which comes from a different kind of test.
  • The full build barely changed (38.3 s versus 37.3 s), because almost 90% of the time goes into generating the article images, which has nothing to do with the bundler.
  • The dev server was a tie and the JS size stayed practically the same.
  • Nothing broke. Two new warnings showed up, and neither was my code's fault.
  • Measure your build before migrating. If the bottleneck isn't the bundler, Vite 8 won't save your CI.

What changed under the hood#

Up to Vite 7, Vite used two different tools. In npm run dev, esbuild pre-bundled the dependencies and transformed TypeScript and JSX. In npm run build, Rollup did the bundling.

esbuild and Rollup are out, Rolldown runs in both commands

The Vite 8 announcement explains why: there were two pipelines and two plugin systems, with more and more glue code to keep them in sync. Every fix on one side risked creating a difference on the other.

In Vite 8, according to the migration guide:

  • Rolldown pre-bundles the dependencies in dev and bundles the app in the build;
  • Oxc transforms the JavaScript and minifies the JS;
  • Lightning CSS minifies the CSS;
  • esbuild became an optional dependency: you only need it if you use something like build.minify: 'esbuild'.

What about plugins? Rolldown supports the same plugin API as Rollup and Vite. On my site that was literal: the articles' MDX is compiled by @mdx-js/rollup, a plugin made for Rollup, and it runs on Vite 8 without any change.

How I measured#

I copied the site at the latest commit to a folder outside the repository, twice. In one, I left everything as is. In the other, I downgraded to Vite 7:

package.json (copy on Vite 7)
"devDependencies": {
  "@vitejs/plugin-react": "^5.2.0",
  "vite": "7.3.8"
}

That's it. @vitejs/plugin-react went down too because version 6 requires Vite 8 (and, as I explain further down, it isn't even used here). Everything else stayed the same: React Router 7.18.5, Tailwind 4, MDX, the same lockfile versions.

  • Versions: Vite 7.3.8 versus Vite 8.3.2 (Rolldown 1.2.12).
  • Machine: MacBook with an M5 and 16 GB, Node 26.
  • Cold build: before each run I deleted the build folder and the cache in node_modules/.vite.
  • Runs: seven builds of each, alternating Vite 7 and Vite 8, and I use the median.
  • Quiet machine: only the runs with the system load around 3 and no other build running count. Further down I explain why this made all the difference.

The measured command is react-router build, which runs the client build, the server build and prerenders 56 pages to HTML. The tsc that runs first in npm run build was left out, because it doesn't depend on Vite.

And, to measure only Vite, I added an environment variable to the copy that skips generating the article images. Without it, the bundler's time disappears inside the image time. More on that soon.

The numbers#

Vite 7.3.8Vite 8.3.2Difference
Client build2.47 s1.35 s1.8x
Server build and prerendering0.86 s0.70 s1.2x
react-router build without images4.13 s2.84 s1.45x
Peak memory of the build1,155 MB1,033 MB11% less
Dev server ready (cold start)0.63 s0.67 stie
Client JS, gzipped498.7 KB492.8 KB1.2% smaller
CSS, gzipped12.3 KB12.3 KBsame
Median of seven cold builds each. The gain shows up where the work belongs to the bundler

Where the work belongs to the bundler, Rolldown delivered. The client build, with about 2,500 modules, dropped almost by half, and the process used about 11% less memory.

The server side gained less, because that time also includes prerendering the 56 pages, which is React generating HTML, not the bundler.

The dev server was a tie. Both start in under a second and, on the first visit, do the same thing: discover the dependencies, pre-bundle them, print optimized dependencies changed. reloading and reload the page. That makes sense: the announcement doesn't promise a faster dev server in Vite 8. What's coming for that is Full Bundle Mode, still experimental, with preliminary results of a 3x faster startup.

The size practically didn't change. The JS came out 2% bigger uncompressed and 1.2% smaller gzipped. The CSS was 0.7 KB bigger uncompressed and the same compressed, and the migration guide already warns that Lightning CSS may make the CSS slightly bigger.

What about the 10 to 30 times?#

The announcement's number is real, but it measures something else. The Rolldown page shows a benchmark that bundles 19,000 modules with minification and source maps: Rolldown takes 1.61 s and Rollup with esbuild, 40.10 s. My client build has about 2,500.

The announcement also includes numbers from companies that tested rolldown-vite before the launch: at Linear, the production build dropped from 46 s to 6 s; Ramp reports 57% less; Beehiiv, 64%; Mercedes-Benz.io, up to 38%. Those are their numbers, from projects much bigger than a portfolio.

Mine is this one: 1.8x on the client build. The bigger the project, the more the difference tends to show.

Where my build time goes#

This is where the surprise came. With the article images turned on, the full build took 38.3 s on Vite 7 and 37.3 s on Vite 8. One second apart.

The red part is what Rolldown speeds up. The black part is sharp, the same on both versions

The reason: every article image becomes AVIF and WebP in up to four widths, and the build also generates a watermarked copy. That's sharp working inside a plugin of mine, in generateBundle. That's 222 files coming out of 28 images, and the bundler doesn't speed up a single millisecond of it.

vite/articles/plugin.ts
async generateBundle() {
  if (this.environment?.config.consumer !== 'client') return
  const slugs = [...new Set((await readArticles({ includeDrafts })).map((article) => article.slug))]
  for await (const { fileName, source } of articleImageVariants(slugs)) {
    this.emitFile({ type: 'asset', fileName, source })
  }
},

To tell one thing from the other, I wrapped that loop with a timer. The whole loop took about 34 s on both versions. emitFile, the part that hands the files to the bundler, added up to about 10 milliseconds. Everything else was encoding images.

Later I noticed I didn't even need the timer. Vite 8 prints this on its own at the end of the build:

[PLUGIN_TIMINGS] JavaScript callbacks ran for 35.3s of this 35.5s build (99%).
The slowest callbacks, timed inside each callback (the wait before a callback starts is excluded, the time it awaits is included):
  - plugin portfolio:articles generateBundle (96%, 34.0s, 1 call)

It's a Rolldown check, checks.bundlerTimings, on by default: when the build takes more than 3 seconds and almost all of the time is in JavaScript plugins, it lists the slowest callbacks. Vite 7 doesn't have this warning. And it was in my log since the very first run, in yellow, and I missed it.

In other words: if your build is slow because of images, prerendering or tsc, swapping the bundler won't fix it. My next step here is a disk cache for the images that didn't change, not Vite 9.

What broke (and what only warned)#

Nothing broke. The build passed on the first try on both versions and the pages came out the same. But Vite 8 showed two warnings that 7 didn't.

"The envFile option is deprecated"#

The `envFile` option is deprecated, please use `envDir: false` instead.

This one shows up nine times per build, and I don't use envFile anywhere. I searched node_modules and found it: it's the React Router plugin 7.18.5 that creates internal Vite servers with envFile: false.

There's nothing to do on my side. In React Router 8 it no longer shows up (I checked the 8.5.1 package), but moving to version 8 is a separate migration. If you see this warning and don't use the option either, it's probably a plugin.

"unsupported by configLoader: 'native'"#

(!) Your Vite config uses features that are unsupported by `configLoader: 'native'`,
which is planned to become the default in a future major version of Vite:
  - import "../../shared/types" resolves to a directory index (src/features/articles/paths.ts:1:29)
  - import "./trails" without a file extension (src/features/articles/paths.ts:2:30)

This one is more interesting. The config documentation explains that Vite has a new way to load vite.config.ts: the native loader, which runs the file directly in Node instead of bundling it first. And the plan is for it to become the default in a future major version.

The native loader follows Node's rules, which don't allow imports without an extension or imports of a folder. Since my vite.config.ts imports the blog plugins, and they import paths.ts, Vite warns.

The catch: those two imports are import type, which disappear when TypeScript becomes JavaScript. So they don't even exist when the file runs. And Vite itself has already fixed this: the changelog for version 8.3.8 says the check now skips type-only imports. I installed 8.3.8 in a copy, ran the build, and the warning was gone. The fix here is just updating Vite.

@vitejs/plugin-react 6 (which I don't even use)#

Vite 8 shipped together with @vitejs/plugin-react 6, which dropped Babel and now does React Refresh with Oxc. If you use the React Compiler, you enable it through @rolldown/plugin-babel with reactCompilerPreset, and since version 6.1 there's also an experimental mode that runs the compiler without Babel.

On my site, none of this matters: the React Router plugin is what handles React here, and @vitejs/plugin-react sits in package.json without being imported anywhere. I found that out while setting up the Vite 7 copy, and it's going out in the next cleanup.

Worth knowing: the React Router plugin still uses Babel to split server code from client code in each route. So "Vite 8 without Babel" depends on who's in your plugin list.

The MDX plugin cast#

This isn't a warning, it's a typing detail. @mdx-js/rollup is typed against Rollup, and Vite 8's Plugin is typed against Rolldown. At runtime it works the same, but TypeScript complains, so my plugin has a cast with a comment explaining it (shortened here):

vite/articles/mdx.ts
// @mdx-js/rollup is typed against Rollup; Vite 8 (Rolldown) runs it as is.
const plugin = mdxRollup({ remarkPlugins, rehypePlugins }) as unknown as Plugin

If you're going to migrate#

My site is small and has no custom build config, which is why it went smoothly. These are the points from the migration guide that catch bigger projects the most:

  • build.rollupOptions became build.rolldownOptions. The old name still works, but it's deprecated.
  • The esbuild option became oxc. Vite converts most of it on its own, but esbuild.banner and esbuild.footer have no conversion.
  • The object form of manualChunks no longer works, and the function form is deprecated. The replacement is Rolldown's codeSplitting.
  • The default import from CommonJS modules is now consistent. If an import from an old package breaks, legacy.inconsistentCjsInterop: true brings back the previous behavior while you fix it.
  • The minimum browsers went up: Safari 16.4, Chrome 111, Firefox 114.
  • Parallel hooks in Rollup plugins run sequentially.
  • Node stays the same as Vite 7: 20.19+ or 22.12+.

For big projects, the announcement itself suggests going in two steps: first the rolldown-vite package (Vite 7 with Rolldown, without the other changes in 8) and then Vite 8. That way, if something breaks, you know whether it was the bundler or the rest.

What I learned#

My first measurement was wrong. It said Vite 8 was slower: 139 s versus 83 s on the full build. At the time, the machine had other heavy processes running and was using more than 20 GB of swap. When I repeated it with the machine quiet, the full build came out at about 38 s on both versions. Benchmarking on a busy computer measures the computer, not the tool.

Measure the whole build, not just the bundler. Images were almost 90% of my build, and Vite 8 said so at the end of every build. Had I looked only at the bundler number, I'd have celebrated Vite 8 and kept waiting the same amount of time. Read the log before celebrating (or complaining about) the new version.

The announcement's number is about the bundler, not your project. "10 to 30 times" is Rolldown versus Rollup bundling 19,000 modules. On my site, with about 2,500, it was 1.8x. Both numbers are true.

A new warning isn't a new error. Both Vite 8 warnings came from outside my code: one from a dependency, the other from a check that Vite itself has already adjusted. Reading where a warning comes from saved me an afternoon of "fixing" something that wasn't broken.

Caveats about these numbers#

  • It's a single machine. An M5 with 16 GB and Node 26. On your computer, or in CI, the absolute times will be different.
  • It's a small project. About 2,500 modules on the client. In a project with many thousands of modules, Rolldown's advantage tends to grow.
  • I measured the dev server the way I use it: start the server and open the pages in Chrome. I didn't measure HMR.
  • The full build had two runs each, not seven, because each one takes almost 40 s. The difference between versions (1 s) is smaller than the variation in image time between runs.
  • I measured without tsc. In the real npm run build, it adds the same time on both versions.

References#

  • Front-end
  • vite
  • rolldown
  • react-router
  • build
  • performance

Written by

Software engineer and designer. I write about what I run into while building apps, APIs and products.