# Behavior traces — babel/babel

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

# Behavior traces — 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.

The source was followed through API compilation, CLI startup and output, and register persistence. These traces preserve execution order and important early exits. Additional inspected branches cover stdin, watch dependencies, standalone scripts, and automatic source-map consumption. They are source-derived walkthroughs rather than observed runtime executions.
- API compilation: transformSync/transformAsync → transformRunner → loadConfig/loadFullConfig → loadPrivatePartialConfig → buildRootChain; null config ends the flow, otherwise run performs compilation. — [packages/babel-core/src/transform.ts#L21-29](https://github.com/babel/babel/blob/7c1dcfac003791a7fee733ed13851a5cac1ccf1c/packages/babel-core/src/transform.ts#L21-L29) [packages/babel-core/src/transform.ts#L56-64](https://github.com/babel/babel/blob/7c1dcfac003791a7fee733ed13851a5cac1ccf1c/packages/babel-core/src/transform.ts#L56-L64) [packages/babel-core/src/config/full.ts#L58-69](https://github.com/babel/babel/blob/7c1dcfac003791a7fee733ed13851a5cac1ccf1c/packages/babel-core/src/config/full.ts#L58-L69) [packages/babel-core/src/config/partial.ts#L102-114](https://github.com/babel/babel/blob/7c1dcfac003791a7fee733ed13851a5cac1ccf1c/packages/babel-core/src/config/partial.ts#L102-L114)
- Compiler execution: run → normalizeOptions, including manipulateOptions → normalizeFile/parser → transformFile; each pass constructs PluginPass objects, invokes pre, merges/traverses visitors, invokes post, then generateCode runs. — [packages/babel-core/src/transformation/normalize-opts.ts#L63-71](https://github.com/babel/babel/blob/7c1dcfac003791a7fee733ed13851a5cac1ccf1c/packages/babel-core/src/transformation/normalize-opts.ts#L63-L71) [packages/babel-core/src/transformation/index.ts#L41-63](https://github.com/babel/babel/blob/7c1dcfac003791a7fee733ed13851a5cac1ccf1c/packages/babel-core/src/transformation/index.ts#L41-L63) [packages/babel-core/src/transformation/index.ts#L83-132](https://github.com/babel/babel/blob/7c1dcfac003791a7fee733ed13851a5cac1ccf1c/packages/babel-core/src/transformation/index.ts#L83-L132)
- CLI startup: bin/babel.js imports lib/babel/index.js → parseArgv parses, expands/sorts globs, deduplicates inputs, and validates combinations → dispatcher selects dirCommand/fileCommand; validation failure sets exitCode 2. — [packages/babel-cli/bin/babel.js#L1-7](https://github.com/babel/babel/blob/7c1dcfac003791a7fee733ed13851a5cac1ccf1c/packages/babel-cli/bin/babel.js#L1-L7) [packages/babel-cli/src/babel/options.ts#L192-225](https://github.com/babel/babel/blob/7c1dcfac003791a7fee733ed13851a5cac1ccf1c/packages/babel-cli/src/babel/options.ts#L192-L225) [packages/babel-cli/src/babel/options.ts#L269-275](https://github.com/babel/babel/blob/7c1dcfac003791a7fee733ed13851a5cac1ccf1c/packages/babel-cli/src/babel/options.ts#L269-L275) [packages/babel-cli/src/babel/index.ts#L7-17](https://github.com/babel/babel/blob/7c1dcfac003791a7fee733ed13851a5cac1ccf1c/packages/babel-cli/src/babel/index.ts#L7-L17)
- Directory compilation: handle enumerates inputs → handleFile → write checks extension and calls util.compile → transformFileAsync resolves config and reads source → write emits map/code and chmod; ignored or non-compilable inputs may instead be copied. — [packages/babel-cli/src/babel/dir.ts#L25-71](https://github.com/babel/babel/blob/7c1dcfac003791a7fee733ed13851a5cac1ccf1c/packages/babel-cli/src/babel/dir.ts#L25-L71) [packages/babel-cli/src/babel/dir.ts#L95-131](https://github.com/babel/babel/blob/7c1dcfac003791a7fee733ed13851a5cac1ccf1c/packages/babel-cli/src/babel/dir.ts#L95-L131) [packages/babel-cli/src/babel/util.ts#L105-117](https://github.com/babel/babel/blob/7c1dcfac003791a7fee733ed13851a5cac1ccf1c/packages/babel-cli/src/babel/util.ts#L105-L117) [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)
- Stdin compilation: fileCommand → stdin → readStdin collects UTF-8 text until end → transformRepl calls callback-based babel.transform → output/buildResult emits stdout or the requested file. — [packages/babel-cli/src/babel/file.ts#L94-150](https://github.com/babel/babel/blob/7c1dcfac003791a7fee733ed13851a5cac1ccf1c/packages/babel-cli/src/babel/file.ts#L94-L150) [packages/babel-cli/src/babel/file.ts#L243-247](https://github.com/babel/babel/blob/7c1dcfac003791a7fee733ed13851a5cac1ccf1c/packages/babel-cli/src/babel/file.ts#L243-L247) [packages/babel-cli/src/babel/util.ts#L89-102](https://github.com/babel/babel/blob/7c1dcfac003791a7fee733ed13851a5cac1ccf1c/packages/babel-cli/src/babel/util.ts#L89-L102)
- Watch updates: enable creates FSWatcher → compile records externalDependencies → updateExternalDependencies updates forward/reverse indexes → startWatcher adds queued paths → add/change events identify affected inputs and directory callbacks invoke handleFile. — [packages/babel-cli/src/babel/watcher.ts#L12-38](https://github.com/babel/babel/blob/7c1dcfac003791a7fee733ed13851a5cac1ccf1c/packages/babel-cli/src/babel/watcher.ts#L12-L38) [packages/babel-cli/src/babel/watcher.ts#L71-118](https://github.com/babel/babel/blob/7c1dcfac003791a7fee733ed13851a5cac1ccf1c/packages/babel-cli/src/babel/watcher.ts#L71-L118) [packages/babel-cli/src/babel/util.ts#L111-115](https://github.com/babel/babel/blob/7c1dcfac003791a7fee733ed13851a5cac1ccf1c/packages/babel-cli/src/babel/util.ts#L111-L115) [packages/babel-cli/src/babel/dir.ts#L227-249](https://github.com/babel/babel/blob/7c1dcfac003791a7fee733ed13851a5cac1ccf1c/packages/babel-cli/src/babel/dir.ts#L227-L249)
- Register persistence: register → hook.register → compile/client.transform → worker handleMessage TRANSFORM → worker transform loads options and checks cache → transformAsync/store; exit or signal handling sends SAVE → saveCache → Cache.flush. — [packages/babel-register/src/index.ts#L10-30](https://github.com/babel/babel/blob/7c1dcfac003791a7fee733ed13851a5cac1ccf1c/packages/babel-register/src/index.ts#L10-L30) [packages/babel-register/src/hook.ts#L30-54](https://github.com/babel/babel/blob/7c1dcfac003791a7fee733ed13851a5cac1ccf1c/packages/babel-register/src/hook.ts#L30-L54) [packages/babel-register/src/worker/handle-message.ts#L10-21](https://github.com/babel/babel/blob/7c1dcfac003791a7fee733ed13851a5cac1ccf1c/packages/babel-register/src/worker/handle-message.ts#L10-L21) [packages/babel-register/src/worker/transform.ts#L97-145](https://github.com/babel/babel/blob/7c1dcfac003791a7fee733ed13851a5cac1ccf1c/packages/babel-register/src/worker/transform.ts#L97-L145)
- Browser execution: DOMContentLoaded → transformScriptTags → runScripts filters script tags → loadScripts obtains inline text or loads src by XHR → check runs eligible scripts in order, allowing async tags to bypass waiting → run appends transformed script elements. — [packages/babel-standalone/src/index.ts#L259-276](https://github.com/babel/babel/blob/7c1dcfac003791a7fee733ed13851a5cac1ccf1c/packages/babel-standalone/src/index.ts#L259-L276) [packages/babel-standalone/src/transformScriptTags.ts#L105-143](https://github.com/babel/babel/blob/7c1dcfac003791a7fee733ed13851a5cac1ccf1c/packages/babel-standalone/src/transformScriptTags.ts#L105-L143) [packages/babel-standalone/src/transformScriptTags.ts#L173-233](https://github.com/babel/babel/blob/7c1dcfac003791a7fee733ed13851a5cac1ccf1c/packages/babel-standalone/src/transformScriptTags.ts#L173-L233) [packages/babel-standalone/src/transformScriptTags.ts#L240-269](https://github.com/babel/babel/blob/7c1dcfac003791a7fee733ed13851a5cac1ccf1c/packages/babel-standalone/src/transformScriptTags.ts#L240-L269)

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)
