# Data flow — babel/babel

> Canonical page: https://codevetter.com/unpack/babel/data-flow

# Data flow — babel/babel

Scanned commit 7c1dcfac003791a7fee733ed13851a5cac1ccf1c (2026-09-30). Generated by codevetter codevetter 1.15.0 on 2026-10-02.

Source inspection; upstream code and tests were not executed.

Compilation begins with source text or a filename plus validated options. Configuration establishes absolute paths, targets, plugin descriptors, and ordered passes before parsing or transforming. Per-file state owns the AST, normalized options, metadata, and incoming map, then returns code and dependency information. CLI adapters write outputs, while register optionally caches compiled results across processes.
- loadPrivatePartialConfig validates input options, resolves cwd/root/filename, constructs an environment/caller context, builds the root chain, and resolves targets. — [packages/babel-core/src/config/partial.ts#L71-125](https://github.com/babel/babel/blob/7c1dcfac003791a7fee733ed13851a5cac1ccf1c/packages/babel-core/src/config/partial.ts#L71-L125)
- buildRootChain merges root config, relative file config, and programmatic config in that precedence order; ignored files receive empty plugin/preset lists and fileHandling='ignored'. — [packages/babel-core/src/config/config-chain.ts#L275-288](https://github.com/babel/babel/blob/7c1dcfac003791a7fee733ed13851a5cac1ccf1c/packages/babel-core/src/config/config-chain.ts#L275-L288)
- loadFullConfig expands preset descriptors into plugin passes, normally reversing preset order; explicit plugin descriptors are inserted first in the initial pass. — [packages/babel-core/src/config/full.ts#L111-161](https://github.com/babel/babel/blob/7c1dcfac003791a7fee733ed13851a5cac1ccf1c/packages/babel-core/src/config/full.ts#L111-L161) [packages/babel-core/src/config/full.ts#L177-200](https://github.com/babel/babel/blob/7c1dcfac003791a7fee733ed13851a5cac1ccf1c/packages/babel-core/src/config/full.ts#L177-L200)
- transformFileRunner resolves configuration before reading UTF-8 source; a null configuration returns null without reading or compiling the input file. — [packages/babel-core/src/transform-file.ts#L18-28](https://github.com/babel/babel/blob/7c1dcfac003791a7fee733ed13851a5cac1ccf1c/packages/babel-core/src/transform-file.ts#L18-L28)
- normalizeFile wraps Program roots as File nodes, rejects other roots, optionally clones supplied ASTs, or parses source; incoming maps come from an explicit object or trailing sourceMappingURL. — [packages/babel-core/src/transformation/normalize-file.ts#L35-65](https://github.com/babel/babel/blob/7c1dcfac003791a7fee733ed13851a5cac1ccf1c/packages/babel-core/src/transformation/normalize-file.ts#L35-L65) [packages/babel-core/src/transformation/normalize-file.ts#L67-105](https://github.com/babel/babel/blob/7c1dcfac003791a7fee733ed13851a5cac1ccf1c/packages/babel-core/src/transformation/normalize-file.ts#L67-L105)
- run returns FileResult metadata, normalized options, optional AST/code/map, actual sourceType, and a freshly flattened externalDependencies Set after transformation. — [packages/babel-core/src/transformation/index.ts#L36-80](https://github.com/babel/babel/blob/7c1dcfac003791a7fee733ed13851a5cac1ccf1c/packages/babel-core/src/transformation/index.ts#L36-L80) [packages/babel-core/test/external-dependencies.js#L36-44](https://github.com/babel/babel/blob/7c1dcfac003791a7fee733ed13851a5cac1ccf1c/packages/babel-core/test/external-dependencies.js#L36-L44)
- Directory output derives destination paths from input-relative paths and output-extension options, writes optional map sidecars before code, and copies permissions; file mode combines source maps with line offsets. — [packages/babel-cli/src/babel/dir.ts#L29-71](https://github.com/babel/babel/blob/7c1dcfac003791a7fee733ed13851a5cac1ccf1c/packages/babel-cli/src/babel/dir.ts#L29-L71) [packages/babel-cli/src/babel/file.ts#L29-67](https://github.com/babel/babel/blob/7c1dcfac003791a7fee733ed13851a5cac1ccf1c/packages/babel-cli/src/babel/file.ts#L29-L67)
- Register cache keys hash serialized resolved options, Babel version, and environment; matching source mtime permits reuse, while new code/map values enter memory and compressed disk batches. — [packages/babel-register/src/worker/transform.ts#L27-53](https://github.com/babel/babel/blob/7c1dcfac003791a7fee733ed13851a5cac1ccf1c/packages/babel-register/src/worker/transform.ts#L27-L53) [packages/babel-register/src/worker/transform.ts#L112-122](https://github.com/babel/babel/blob/7c1dcfac003791a7fee733ed13851a5cac1ccf1c/packages/babel-register/src/worker/transform.ts#L112-L122) [packages/babel-register/src/worker/cache.ts#L100-125](https://github.com/babel/babel/blob/7c1dcfac003791a7fee733ed13851a5cac1ccf1c/packages/babel-register/src/worker/cache.ts#L100-L125)

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)
