Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.

# Rolldown

> Fast Rust-based bundler for JavaScript with Rollup-compatible API

- ⚡ Lightning Fast Performance
- 🔌 Rollup-Compatible APIs
- ⏩ esbuild Feature Parity

Rolldown is primarily designed to serve as the underlying bundler in [Vite](https://vite.dev/), with the goal to replace esbuild and Rollup with one unified build tool. Although designed for Vite, Rolldown is also fully capable of being used as a standalone, general-purpose bundler. It can serve as a drop-in replacement for Rollup in most cases, and can also be used as an esbuild alternative when better chunking control is needed.

[Read the Docs to Learn More](https://rolldown.rs).

rolldown

Thin CLI wrapper layer on top of [rollup][] api to allow loading configs from package.json file

nyc check-coverage --lines 0 --branches 0 --statements 0 --functions 0

nyc report --reporter=text-lcov | coveralls

Thin layer on top of [rollup][] api to allow loading configs from package.json file

nyc report --reporter=text-lcov | coveralls

always-done async-done base charlike commitizen dezalgo once rollup standard-version verb verb-generate-readme

chokidar 'src/test.js' -c 'npm run devbuild'

Modern bundler built on [rollup][] with support for presets and better configuration experience

wip

wip

wip

wip

wip

echo 'BABEL_ENV=build rolldown --pkg-dir $PWD'

wip

wip

wip wip wip wip wip wip wip wip wip wip wip

webpack parcel esbuild rollup bundler rolldown

prettier --write src/binding.js src/binding.d.ts

napi build -o=./src --manifest-path ../../crates/rolldown_binding/Cargo.toml --platform -p rolldown_binding --js binding.js --dts binding.d.ts --dts-header "type MaybePromise<T> = T | Promise<T>"

napi build -o=./src --release --manifest-path ../../crates/rolldown_binding/Cargo.toml --platform -p rolldown_binding --js binding.js --dts binding.d.ts --dts-header "type MaybePromise<T> = T | Promise<T>"

pnpm build-binding && pnpm build-node && pnpm format-generated-binding-files

pnpm build-binding:release && pnpm build-node && pnpm format-generated-binding-files

napi artifacts -o=./artifacts --npm-dir ./npm

napi build -o=./src --manifest-path ../../crates/rolldown_binding/Cargo.toml --platform -p rolldown_binding --js binding.js --dts binding.d.ts --dts-header "type MaybePromise<T> = T | Promise<T>
type Nullable<T> = T | null | undefined
type VoidNullable<T = void> = T | null | undefined | void"

napi build -o=./src --release --manifest-path ../../crates/rolldown_binding/Cargo.toml --platform -p rolldown_binding --js binding.js --dts binding.d.ts --dts-header "type MaybePromise<T> = T | Promise<T>
type Nullable<T> = T | null | undefined
type VoidNullable<T = void> = T | null | undefined | void"

napi artifacts --cwd ./src --package-json-path ../package.json -o=../artifacts --npm-dir ../npm

pnpm build-binding --profile release-wasi --target wasm32-wasi-preview1-threads

pnpm build-binding --target wasm32-wasi-preview1-threads

pnpm build-binding --target wasm32-wasip1-threads

pnpm build-binding --profile release-wasi --target wasm32-wasip1-threads

node ../../node_modules/npm-rolldown/bin/cli.js -c ./rolldown.config.mjs

run-s build-binding build-types build-node

run-s build-binding build-types build-node build-types-check

run-s build-binding:release build-types build-node build-types-check

cross-env ROLLDOWN_TEST=1 vitest run --reporter verbose --hideSkippedTests

cross-env RUST_BACKTRACE=1 ROLLDOWN_TEST=1 vitest run --reporter verbose --hideSkippedTests

type MaybePromise<T> = T | Promise<T>
type Nullable<T> = T | null | undefined
type VoidNullable<T = void> = T | null | undefined | void
export type BindingStringOrRegex = string | RegExp

export interface RenderedModule {
  readonly code: string | null
  renderedLength: number
}

run-s build-binding build-binding:wasi build-node

run-s build-binding build-binding:wasi:release build-node

napi build -o=./src --manifest-path ../../crates/rolldown_binding/Cargo.toml --platform -p rolldown_binding --js binding.cjs --dts binding.d.ts --no-const-enum

node --import @oxc-node/core/register ./build.ts

napi build -o=./src --manifest-path ../../crates/rolldown_binding/Cargo.toml --platform -p rolldown_binding --js binding.js --dts binding.d.ts --no-const-enum --no-dts-cache

run-s build-types build-node build-types-check

pnpm run --sequential "/^build-(types|node|types-check)$/"

pnpm run --sequential "/^build-(binding|js-glue)$/"

pnpm run --sequential "/^build-(binding:release|js-glue)$/"

cross-env BROWSER_PKG=1 pnpm run --sequential "/^build-(binding|binding:wasi|node)$/"

cross-env BROWSER_PKG=1 pnpm run --sequential "/^build-(binding|binding:wasi:release|node)$/"

pnpm run --sequential '/^build-(types|node|types-check)$/'

pnpm run --sequential '/^build-(binding|js-glue)$/'

pnpm run --sequential '/^build-(binding:release|js-glue)$/'

BROWSER_PKG=1 pnpm run --sequential '/^build-(binding|binding:wasi|node)$/'

BROWSER_PKG=1 pnpm run --sequential '/^build-(binding|binding:wasi:release|node)$/'

pnpm build-binding --profile memory-profile --features default_global_allocator

pnpm run --sequential '/^build-(binding:memory-profile|js-glue)$/'

pnpm run --sequential '/^build-(node|types-check)$/'

pnpm run build-binding:profile && pnpm run build-js-glue

pnpm run build-binding:profile --features default_global_allocator && pnpm run build-js-glue

TARGET='rolldown-wasi' pnpm run --sequential '/^build-(binding|binding:wasi|node)$/'

TARGET='rolldown-wasi' pnpm run --sequential '/^build-(binding|binding:wasi:release|node)$/'

TARGET='browser' pnpm run --sequential '/^build-(binding|binding:wasi|node)$/'

TARGET='browser' pnpm run --sequential '/^build-(binding|binding:wasi:release|node)$/'

type MaybePromise<T> = T | Promise<T>
type Nullable<T> = T | null | undefined
type VoidNullable<T = void> = T | null | undefined | void
export type BindingStringOrRegex = string | RegExp
type BindingResult<T> = { errors: BindingError[], isBindingErrors: boolean } | T

bundler esbuild parcel rolldown rollup webpack

type MaybePromise<T> = T | Promise<T>
type Nullable<T> = T | null | undefined
type VoidNullable<T = void> = T | null | undefined | void
export type BindingStringOrRegex = string | RegExp
export type BindingResult<T> = { errors: BindingError[], isBindingErrors: boolean } | T

TARGET='browser' pnpm run --sequential '/^build-(binding:wasi|node)$/'

TARGET='browser' pnpm run --sequential '/^build-(binding:wasi:release|node)$/'

node --enable-source-maps --import @oxc-node/core/register -C dev ./build.ts

pnpm build-binding --profile profile --features chrome-tracing