# Behavior traces — rollup/rollup

> Canonical page: https://codevetter.com/unpack/rollup/behavior-traces

# Behavior traces — rollup/rollup

Scanned commit a77225f4b9ef88f20d26a32a3dc70954241f3fb6 (2026-10-02). Generated by codevetter codevetter 1.15.0 on 2026-10-02.

Source inspection; upstream code and tests were not executed.

Three concrete flows were followed through their implementation: CLI configuration builds, API build-to-output generation, and watch invalidation-to-rebuild. The CLI adds executable configuration loading and stdout handling around the API. The API separates graph construction from rendering and disk writes. Watch mode retains cache and coordinates asynchronous change notifications before another build.
- CLI startup runs argParser → runRollup → getConfigs; config mode resolves a configuration path and calls loadConfigFile, otherwise it loads options from the command. — [cli/cli.ts#L9-26](https://github.com/rollup/rollup/blob/a77225f4b9ef88f20d26a32a3dc70954241f3fb6/cli/cli.ts#L9-L26) [cli/run/index.ts#L86-95](https://github.com/rollup/rollup/blob/a77225f4b9ef88f20d26a32a3dc70954241f3fb6/cli/run/index.ts#L86-L95)
- Configuration loading runs getConfigFileExport → getConfigList → mergeOptions → addCommandPluginsToInputOptions; exports may be objects, arrays, promises, or functions receiving command options. — [cli/run/loadConfigFile.ts#L27-44](https://github.com/rollup/rollup/blob/a77225f4b9ef88f20d26a32a3dc70954241f3fb6/cli/run/loadConfigFile.ts#L27-L44) [cli/run/loadConfigFile.ts#L184-191](https://github.com/rollup/rollup/blob/a77225f4b9ef88f20d26a32a3dc70954241f3fb6/cli/run/loadConfigFile.ts#L184-L191)
- With configPlugin or bundleConfigAsCjs, configuration loading builds the config → generates ES/CJS code → writes a sibling temporary config → imports its default export → schedules unlink in finally. — [cli/run/loadConfigFile.ts#L56-58](https://github.com/rollup/rollup/blob/a77225f4b9ef88f20d26a32a3dc70954241f3fb6/cli/run/loadConfigFile.ts#L56-L58) [cli/run/loadConfigFile.ts#L132-180](https://github.com/rollup/rollup/blob/a77225f4b9ef88f20d26a32a3dc70954241f3fb6/cli/run/loadConfigFile.ts#L132-L180)
- The CLI builds configurations sequentially; each build obtains an await-using bundle, generates the first output to stdout when destinationless, or writes configured outputs concurrently. — [cli/run/index.ts#L61-70](https://github.com/rollup/rollup/blob/a77225f4b9ef88f20d26a32a3dc70954241f3fb6/cli/run/index.ts#L61-L70) [cli/run/build.ts#L33-50](https://github.com/rollup/rollup/blob/a77225f4b9ef88f20d26a32a3dc70954241f3fb6/cli/run/build.ts#L33-L50)
- API startup runs rollup → rollupInternal → getInputOptions → initWasm → Graph construction → buildStart → Graph.build → buildEnd; failures call buildEnd with the error and closeBundle. — [src/rollup/rollup.ts#L45-61](https://github.com/rollup/rollup/blob/a77225f4b9ef88f20d26a32a3dc70954241f3fb6/src/rollup/rollup.ts#L45-L61) [src/rollup/rollup.ts#L72-102](https://github.com/rollup/rollup/blob/a77225f4b9ef88f20d26a32a3dc70954241f3fb6/src/rollup/rollup.ts#L72-L102)
- Output generation runs handleGenerateWrite → output option/plugin-driver setup → Bundle.generate → renderStart → generateChunks → renderChunks → generateBundle → asset finalization → filename validation. — [src/rollup/rollup.ts#L193-212](https://github.com/rollup/rollup/blob/a77225f4b9ef88f20d26a32a3dc70954241f3fb6/src/rollup/rollup.ts#L193-L212) [src/Bundle.ts#L55-103](https://github.com/rollup/rollup/blob/a77225f4b9ef88f20d26a32a3dc70954241f3fb6/src/Bundle.ts#L55-L103)
- write additionally requires file or dir, queues writeOutputFile for generated files, and runs writeBundle after writes resolve; generate returns without this persistence branch. — [src/rollup/rollup.ts#L213-226](https://github.com/rollup/rollup/blob/a77225f4b9ef88f20d26a32a3dc70954241f3fb6/src/rollup/rollup.ts#L213-L226) [src/rollup/rollup.ts#L312-322](https://github.com/rollup/rollup/blob/a77225f4b9ef88f20d26a32a3dc70954241f3fb6/src/rollup/rollup.ts#L312-L322)
- Watch startup merges/filter configs and constructs Watcher; filesystem events run Task.invalidate → Watcher.invalidate → pending-change announcements → restart → Task.run → rollupInternal → optional output writes → BUNDLE_END. — [src/watch/watch-proxy.ts#L74-98](https://github.com/rollup/rollup/blob/a77225f4b9ef88f20d26a32a3dc70954241f3fb6/src/watch/watch-proxy.ts#L74-L98) [src/watch/fileWatcher.ts#L49-64](https://github.com/rollup/rollup/blob/a77225f4b9ef88f20d26a32a3dc70954241f3fb6/src/watch/fileWatcher.ts#L49-L64) [src/watch/watch.ts#L74-150](https://github.com/rollup/rollup/blob/a77225f4b9ef88f20d26a32a3dc70954241f3fb6/src/watch/watch.ts#L74-L150) [src/watch/watch.ts#L246-288](https://github.com/rollup/rollup/blob/a77225f4b9ef88f20d26a32a3dc70954241f3fb6/src/watch/watch.ts#L246-L288)

Every claim links to its cited files at the pinned commit. Citations identify source evidence; they do not establish runtime correctness. Independent CodeVetter scan — not reviewed by upstream maintainers.

## Public product links

- [CodeVetter](https://codevetter.com/)
- [Download](https://codevetter.com/download)
- [Documentation](https://codevetter.com/docs/)
- [Source](https://github.com/Codevetter/codevetter)
