# rollup

Rollup driver: per-format descriptor builders and the per-entry forked-worker dispatcher.

Every format is bundled the same way: build a serializable descriptor and hand it to the worker. The descriptor builders ([`toEsmBuildDescriptor`](https://www.hyperfrontend.dev/docs/libraries/builder/bundle/rollup/#api-toEsmBuildDescriptor), [`toCjsBuildDescriptor`](https://www.hyperfrontend.dev/docs/libraries/builder/bundle/rollup/#api-toCjsBuildDescriptor), [`toIifeBuildDescriptor`](https://www.hyperfrontend.dev/docs/libraries/builder/bundle/rollup/#api-toIifeBuildDescriptor), [`toUmdBuildDescriptor`](https://www.hyperfrontend.dev/docs/libraries/builder/bundle/rollup/#api-toUmdBuildDescriptor), [`toBinBuildDescriptor`](https://www.hyperfrontend.dev/docs/libraries/builder/bundle/rollup/#api-toBinBuildDescriptor)) translate an entry point plus its format config into a [`RollupBuildDescriptor`](https://www.hyperfrontend.dev/docs/libraries/builder/bundle/rollup/#api-RollupBuildDescriptor), validating externals/globals eagerly so the caller fails before a worker is spawned. [`dispatchRollupWorker`](https://www.hyperfrontend.dev/docs/libraries/builder/bundle/rollup/#api-dispatchRollupWorker) forks a child Node process per entry to run that descriptor in isolation (the per-entry boundary that keeps peak memory bounded), or [`runRollupWorkerJob`](https://www.hyperfrontend.dev/docs/libraries/builder/bundle/rollup/#api-runRollupWorkerJob) runs the same descriptor in-process for tests.

The actual Rollup configuration lives entirely inside the worker's `job-runner.ts`: plugin wiring ([`json`](https://www.npmjs.com/package/@rollup/plugin-json), [`node-resolve`](https://www.npmjs.com/package/@rollup/plugin-node-resolve), [`commonjs`](https://www.npmjs.com/package/@rollup/plugin-commonjs), [`typescript`](https://www.npmjs.com/package/@rollup/plugin-typescript), [`terser`](https://www.npmjs.com/package/@rollup/plugin-terser)), output options, and [`onwarn`](https://rollupjs.org/configuration-options/#onwarn) suppression. That file depends only on `rollup` and the `@rollup/plugin-*` packages, so it can bootstrap before any workspace package is built.

---

Canonical page: https://www.hyperfrontend.dev/docs/libraries/builder/bundle/rollup/
This file: https://www.hyperfrontend.dev/docs/libraries/builder/bundle/rollup.md
Documentation index: https://www.hyperfrontend.dev/llms.txt
