rollup

A module bundler for JavaScript that compiles small pieces of code into optimized libraries and applications using native ES modules.

Tool
npm
v4.63.5
26,309 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
91 /100 Excellent
Development Activity 100
Maintenance 96
Community 68
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
90 /100 Excellent
Architecture 93
Code Quality 92
Innovation 88
Learning Curve 85

Rollup is a JavaScript module bundler that compiles small, discrete modules written with the standardized ES module syntax into larger bundles suitable for libraries, applications, and browsers. Unlike bundlers built around CommonJS interop, Rollup treats ES modules as a first-class citizen, which lets it perform aggressive static analysis and tree-shaking to strip out code that is never used.

It is invoked through a CLI or a JavaScript/programmatic API, and produces output in ES, CommonJS, AMD, UMD, IIFE, or SystemJS formats through a set of pluggable finalisers. A hook-based plugin architecture (resolveId, load, transform, renderChunk, and more) lets authors extend module resolution and code generation without modifying Rollup’s core, and this same plugin interface is what powers Vite’s production build step.

Under the hood, Rollup builds a dependency graph of every module reached from the configured entry points, determines which exports are actually used, and only includes code that affects the program’s observable behavior. Recent versions offload parsing to a native Rust binary (via NAPI) or a WebAssembly fallback for platforms without native bindings, trading a Rust toolchain dependency for substantially faster parsing on large codebases.

What You Get

  • A CLI (rollup) and a JavaScript/TypeScript API (rollup() + RollupBuild) for building and watching bundles
  • Tree-shaking driven by static ES module analysis rather than heuristic dead-code elimination
  • Multiple output formats from one build: ES, CommonJS, AMD, UMD, IIFE, and SystemJS
  • A hook-based plugin system (resolveId, load, transform, renderChunk, generateBundle, and more) for extending resolution, transformation, and code generation
  • Code-splitting with automatic and manual chunking, including dynamic import() support
  • Built-in watch mode for incremental rebuilds during development
  • Native Rust (NAPI) parsing with a WebAssembly fallback for platforms without prebuilt binaries

Common Use Cases

  • Publishing a library - authors bundle a package’s ES module source into ESM and CommonJS builds so consumers on either module system can import or require it
  • Powering another build tool - Vite and similar tools use Rollup’s plugin API directly as their production bundler, rather than reimplementing bundling
  • Shipping a browser bundle - a single <script>-ready IIFE or UMD file is produced from a modular application source tree
  • Building JavaScript plugins/extensions - projects that need a single self-contained file (a CLI tool, a browser extension script, a Rollup plugin itself) bundle their multi-file source into one artifact
  • Enforcing dead-code elimination - projects that care about minimal output size choose Rollup specifically for its ES-module-native tree-shaking over less aggressive bundlers

Under The Hood

Architecture Rollup’s core builds a dependency graph in Graph (src/Graph.ts), which uses a ModuleLoader to resolve and parse every module reachable from the configured entry points into Module/ExternalModule instances, tracking execution order and circular dependencies. A Bundle (src/Bundle.ts) then partitions the included modules into Chunk objects via getChunkAssignments, resolving shared dependencies and manual/automatic chunking rules, before handing each chunk to a finalisers implementation (src/finalisers/{es,cjs,amd,iife,umd,system}.ts) that renders it into the requested output format. A PluginDriver runs plugin hooks (resolveId, load, transform, renderChunk, generateBundle, and others) at each stage, which is the same extension surface Vite builds its production pipeline on top of. What breaks if this core changes: the finaliser and plugin-hook contracts are Rollup’s most load-bearing public surface, since third-party plugins and downstream tools like Vite depend on their exact shapes.

Tech Stack The package is TypeScript compiled to a dual ESM/CommonJS dist/ output, with @types/estree as its only runtime dependency and a large devDependency set (ESLint 9 flat config, Vitest/Mocha for tests, acorn plus custom AST tooling) supporting the build. Parsing is offloaded to a native binary written in Rust (rust/bindings_napi), built with NAPI-RS and distributed as per-platform optional dependencies, with a WebAssembly build (rust/bindings_wasm) as a fallback for platforms lacking a prebuilt native binary — an unusual hybrid JS/Rust architecture among JavaScript bundlers. AST data crosses the JS/Rust boundary via a shared buffer format (bufferToAst.ts, getAstBuffer.ts) rather than JSON serialization, which keeps that handoff fast.

Code Quality The test suite is extensive and organized by concern (test/function, test/form, test/chunking-form, test/sourcemaps, test/incremental, test/hooks, test/browser, test/leak, test/typescript), run through Mocha with a dedicated memory-leak check and a TypeScript type-check pass (test:typescript) in addition to normal unit tests. Linting spans eslint.config.mjs for JS/TS, cargo fmt/cargo clippy for the Rust bindings, and Prettier for Markdown, all wired into CI (ci:lint, ci:test:all) alongside noUnusedLocals/noUnusedParameters strict TypeScript compiler options. Error paths run through a centralized logs.ts/getRollupError module producing structured, coded errors rather than ad hoc throws.

API Design The public API is a single rollup() function returning a RollupBuild with generate/write/close methods, plus a watch() entry point for incremental builds — a small, consistent surface for a tool with this much internal complexity. Plugin authors implement a documented set of named hooks with a stable calling convention (returning null/undefined to defer, a value to short-circuit), and the same hook names are used identically across the CLI config file and the JS API, which keeps the learning curve to one mental model rather than two. Extensive docs (docs/javascript-api, docs/plugin-development, docs/command-line-interface) and interactive migration guides lower the ramp-up cost further.

Used by 53 apps in this directory

TypeScript
72%
AGPL 3.0

APITable

Databases · Low Code Platforms

15,623

API-first collaborative spreadsheet-database platform that auto-generates REST APIs and lets teams build internal tools, CRMs, and dashboards without code.

View details
71
Repo Health
77
Technical
60
Dependency
Built with
TypeScript 72%
Java 22%
Updated 3 weeks ago
TypeScript
68%
Apache 2.0

Appsmith

Automation · Developer Tools · No Code Platforms

40,959

Open-source low-code platform to build admin panels, dashboards, and internal tools connected to any database or API.

View details
93
Repo Health
79
Technical
66
Dependency
Built with
TypeScript 68%
Java 21%
Updated 6 days ago
Python
55%
Other

authentik

Authentication · Security

25,758

The self-hosted Identity Provider that replaces Okta, Auth0, and Entra ID with a unified SSO platform supporting SAML, OAuth2/OIDC, LDAP, RADIUS, and WebAuthn.

View details
92
Repo Health
81
Technical
66
Dependency
Built with
Python 55%
TypeScript 36%
Updated 4 days ago
TypeScript
97%
AGPL 3.0

Bigcapital

Invoicing Finance

3,916

Self-hostable double-entry accounting platform with invoicing, inventory, multi-currency, and real-time financial reporting for small and medium businesses.

View details
90
Repo Health
77
Technical
61
Dependency
Built with
TypeScript 97%
Updated 6 days ago
TypeScript
92%
GPL 3.0

Blinko

Knowledge Management · Note Taking

11,049

A self-hosted, AI-powered card note-taking tool that lets you capture fleeting thoughts instantly and retrieve them with natural language search.

View details
75
Repo Health
69
Technical
63
Dependency
Built with
TypeScript 92%
Updated 1 months ago
TypeScript
100%
MIT

Botpress

AI Assistants · AI Development · Customer Support

14,924

The open-source hub for building and deploying LLM-powered AI agents with TypeScript-first tooling, 40+ integrations, and a revolutionary code-execution agent framework.

View details
94
Repo Health
82
Technical
64
Dependency
Built with
TypeScript 100%
Updated 1 weeks ago
TypeScript
70%
Other

Budibase

Low Code Platforms · No Code Platforms

28,324

Build AI agents, automations, and internal apps on a single open-source platform with full self-hosting control.

View details
91
Repo Health
81
Technical
63
Dependency
Built with
TypeScript 70%
Svelte 26%
Updated 1 weeks ago
Rust
67%
MIT

Bun

Developer Tools

96,068

An all-in-one JavaScript and TypeScript toolkit — one Rust-and-JavaScriptCore binary that replaces Node.js, npm, a bundler, and a test runner with faster equivalents.

View details
92
Repo Health
91
Technical
64
Dependency
Built with
Rust 67%
C++ 19%
TypeScript 10%
Updated 5 days ago
Go
49%
MIT

Bytebase

Devops

14,512

An open-source database CI/CD and DevSecOps platform — schema migration review, GitOps-driven changes, data masking, and access control across MySQL, PostgreSQL, Oracle, Snowflake, MongoDB, and more.

View details
92
Repo Health
73
Technical
68
Dependency
Built with
Go 49%
TypeScript 42%
Updated 4 days ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers