CodeVetter · Repo Unpack · System map
rollup/rollup
Rollup exposes a Node API, a CLI, and a browser API around the same bundling core. Graph owns build state, while Bundle owns one output generation. Parsing and hashing cross a Rust boundary with separate native and WASM adapters. Distribution consists of npm artifacts and platform binaries rather than a running service.
- The Node entry exports VERSION, rollup, defineConfig, and watch; the browser entry exports the first three and omits watch.
- cli/cli.ts parses argv with yargs-parser and commandAliases, handles help/version, and delegates other invocations to run.
- Graph constructs PluginDriver, ModuleLoader, and a maxParallelFileOps queue; its modulesById map holds internal and external modules.
- Each generate/write invocation creates a new Bundle around the existing Graph, allowing output generation without rebuilding the input graph.
- Rust's parse_ast crate uses SWC parsing and AstConverter; NAPI and wasm-bindgen expose parser and xxhash operations to JavaScript.
- native.js selects a platform/architecture package, distinguishes musl where supported, and loads a local .node binary or @rollup/rollup-${packageBase}.
- rollup.config.ts produces CommonJS and ESM Node artifacts plus UMD and ESM browser artifacts; configTest selects only CommonJS and configIsBuildNode selects both Node builds.
- npm run build combines WASM, generated AST converters, release NAPI, JavaScript, and native copying; CI publication depends on lint/tests and gates on v4 refs plus release-shaped commit messages.