DEV Community

Alex Spinov
Alex Spinov

Posted on

Rolldown Has a Free Rust-Powered Bundler — The Future of Vite's Build Engine

Vite uses esbuild for dev and Rollup for production. That split causes subtle bugs. Rolldown fixes it by replacing both — with one Rust-powered bundler.

What is Rolldown?

Rolldown is a Rust-based JavaScript bundler designed to be Rollup-compatible. Built by the Vite team (Evan You and VoidZero), it will eventually become Vite's unified bundler for both dev and production.

Why Rolldown Matters

1. Rollup-Compatible API

// rolldown.config.js
export default {
  input: 'src/index.ts',
  output: {
    dir: 'dist',
    format: 'esm',
  },
  plugins: [
    // Most Rollup plugins work
  ]
};
Enter fullscreen mode Exit fullscreen mode

If you know Rollup, you know Rolldown.

2. Rust Performance

# Benchmark: bundling a large React app
rollup:    12.4s
esbuild:    0.8s
rolldown:   0.5s
Enter fullscreen mode Exit fullscreen mode

Faster than esbuild, with Rollup's plugin ecosystem.

3. Built-in Transformations

export default {
  input: 'src/index.tsx',
  resolve: {
    extensions: ['.ts', '.tsx', '.js', '.jsx']
  },
  // TypeScript and JSX work out of the box
  // No need for @rollup/plugin-typescript or @rollup/plugin-babel
};
Enter fullscreen mode Exit fullscreen mode

4. Tree Shaking

// math.js
export function add(a, b) { return a + b; }
export function multiply(a, b) { return a * b; }
export function divide(a, b) { return a / b; } // unused

// app.js
import { add, multiply } from './math.js';
console.log(add(1, 2), multiply(3, 4));

// Output: divide() is completely removed
Enter fullscreen mode Exit fullscreen mode

Advanced tree shaking with scope hoisting — same quality as Rollup.

5. Parallel Processing

Rolldown leverages Rust's parallelism for:

  • Parsing files concurrently
  • Transforming modules in parallel
  • Parallel code generation

Your 16-core CPU finally does useful work during builds.

Rolldown vs Other Bundlers

Rolldown Rollup esbuild Rspack
Language Rust JavaScript Go Rust
Rollup compat High N/A Low Low
Vite integration Native (planned) Current Dev only Community
Tree shaking Advanced Advanced Basic Advanced
Speed Very fast Slow Fast Fast

What This Means for Vite Users

Today Vite uses:

  • Dev: esbuild (fast, but limited tree shaking)
  • Production: Rollup (thorough, but slow)

This split causes differences between dev and prod builds. Rolldown will unify both into one engine — same behavior in dev and production.

Getting Started

npm install rolldown

# CLI
npx rolldown src/index.ts -d dist

# Or with config
npx rolldown -c rolldown.config.js
Enter fullscreen mode Exit fullscreen mode

The Bottom Line

Rolldown is the future of JavaScript bundling. Rollup's API quality with Rust's speed, built by the Vite team. If you're starting a new project, it's worth trying now.


Need custom data solutions? I build web scraping and extraction tools. Check my Apify actors or email spinov001@gmail.com.

Top comments (0)