Rolldown
A fast Rust-based JavaScript bundler with a Rollup-compatible API, designed to become the bundler powering Vite.
Rolldown is a JavaScript bundler written in Rust, designed to serve as the future bundler powering Vite. It aims to provide Rollup-compatible output and API while achieving dramatically higher performance — enabling Vite to use a single bundler for both development and production builds instead of juggling esbuild and Rollup separately.
Features
- Rollup-compatible — supports a large subset of Rollup's plugin API and configuration format, making migration from Rollup straightforward
- Rust-powered performance — significantly faster than JavaScript-based bundlers on large codebases
- ESM and CJS output — generates both ES module and CommonJS output formats
- Tree-shaking — eliminates unused code from the output bundle
- Code splitting — supports dynamic imports and automatic chunk splitting
- Source maps — generates accurate source maps for debugging
- Plugin system — compatible with the Rollup plugin ecosystem via a Vite/Rollup-compatible plugin interface
- Built-in transforms — handles TypeScript, JSX, and modern JavaScript syntax without external plugins
Status
Rolldown is currently in active development and not yet recommended for general production use outside of Vite's internal adoption. The API is stabilising rapidly as the Vite team works toward making it the default bundler in a future Vite release. It is, however, already usable for experimentation and early adoption.
Installation
# Debian / Ubuntu / Fedora
# npm install works on all Linux distributions:
npm install rolldown
Or use it directly via the CLI:
npx rolldown --helpUsage
CLI
# Bundle an entry point to a file
rolldown src/index.js -o dist/bundle.js
# Bundle with a specific output format
rolldown src/index.js --format esm -o dist/bundle.mjs
rolldown src/index.js --format cjs -o dist/bundle.cjs
# Bundle with source maps
rolldown src/index.js --sourcemap -o dist/bundle.js
# Watch mode
rolldown src/index.js -o dist/bundle.js --watchConfiguration file
Rolldown reads from rolldown.config.js (or .mjs, .ts):
import { defineConfig } from "rolldown";
export default defineConfig({
input: "src/index.ts",
output: {
file: "dist/bundle.js",
format: "esm",
sourcemap: true,
},
plugins: [
// Rollup-compatible plugins work here
],
});Multiple entry points and code splitting
import { defineConfig } from "rolldown";
export default defineConfig({
input: {
main: "src/main.ts",
worker: "src/worker.ts",
},
output: {
dir: "dist",
format: "esm",
chunkFileNames: "chunks/[name]-[hash].js",
},
});Relationship to Vite and Rollup
Rolldown was created specifically to solve a long-standing architectural issue in Vite: the development server uses esbuild for speed, while production builds use Rollup for its mature plugin ecosystem and tree-shaking. The two bundlers produce subtly different output, which can cause dev/prod discrepancies. Rolldown unifies both roles — fast enough for development, full-featured enough for production — while maintaining API compatibility with Rollup so the existing plugin ecosystem continues to work.
Once Rolldown reaches stability, it will be adopted by Vite internally, meaning any Vite-based project (including those using Nuxt, SvelteKit, Astro, and others) will benefit from the performance improvement automatically.