# Data flow — web-infra-dev/rspack

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

# Data flow — web-infra-dev/rspack

Scanned commit 179a0934f3091463419827fc2767af07b2fd38ed (2026-10-01). Generated by codevetter codevetter 1.15.0 on 2026-10-02.

Source inspection; upstream code and tests were not executed.

Configuration enters through either the JavaScript API or CLI loading, then becomes normalized options and native binding inputs. Loader results and compiler passes populate compilation state before assets cross the output filesystem boundary. Rebuilds carry changed paths and prior artifacts into a new compilation. Cache storage follows a separate path with namespaced keys, memory lookup, disk restoration, and deferred persistence.
- CLI config loading resolves an explicit path or discovers rspack.config, passes env and CLI options to baseLoadConfig with fresh:true, and rejects exports that are neither an object nor an array. — [packages/rspack-cli/src/utils/loadConfig.ts#L21-44](https://github.com/web-infra-dev/rspack/blob/179a0934f3091463419827fc2767af07b2fd38ed/packages/rspack-cli/src/utils/loadConfig.ts#L21-L44) [packages/rspack-cli/src/utils/loadConfig.ts#L252-276](https://github.com/web-infra-dev/rspack/blob/179a0934f3091463419827fc2767af07b2fd38ed/packages/rspack-cli/src/utils/loadConfig.ts#L252-L276)
- loadExtendedConfig resolves file URLs, relative/absolute paths, or packages, recursively merges base configuration beneath the current result, and accumulates loaded paths in a WeakMap. — [packages/rspack-cli/src/utils/loadConfig.ts#L174-213](https://github.com/web-infra-dev/rspack/blob/179a0934f3091463419827fc2767af07b2fd38ed/packages/rspack-cli/src/utils/loadConfig.ts#L174-L213) [packages/rspack-cli/src/utils/loadConfig.ts#L222-246](https://github.com/web-infra-dev/rspack/blob/179a0934f3091463419827fc2767af07b2fd38ed/packages/rspack-cli/src/utils/loadConfig.ts#L222-L246)
- createCompiler normalizes options and installs the Node environment before user plugins; it then applies full defaults and options-driven plugins before initialize. — [packages/rspack/src/rspack.ts#L51-88](https://github.com/web-infra-dev/rspack/blob/179a0934f3091463419827fc2767af07b2fd38ed/packages/rspack/src/rspack.ts#L51-L88)
- The JS-to-Rust boundary includes builtin rule references and virtual files in raw options, and adapts input filesystem callbacks only when ThreadsafeInputNodeFS.needsBinding permits it. — [packages/rspack/src/Compiler.ts#L956-988](https://github.com/web-infra-dev/rspack/blob/179a0934f3091463419827fc2767af07b2fd38ed/packages/rspack/src/Compiler.ts#L956-L988)
- Normal loaders consume content, sourceMap, and additionalData; a cache hit restores these values, while executed loaders return transformed values that can be stored for reuse. — [packages/rspack/src/loader-runner/index.ts#L1136-1203](https://github.com/web-infra-dev/rspack/blob/179a0934f3091463419827fc2767af07b2fd38ed/packages/rspack/src/loader-runner/index.ts#L1136-L1203)
- Pass execution checks is_enabled, recovers pass-associated incremental artifacts, invokes cache restore hooks, runs the pass, then invokes save hooks and captures artifacts only after success. — [crates/rspack_core/src/compilation/pass.rs#L65-96](https://github.com/web-infra-dev/rspack/blob/179a0934f3091463419827fc2767af07b2fd38ed/crates/rspack_core/src/compilation/pass.rs#L65-L96)
- CompilerCache prefixes facade names with compiler_path; Cache.get checks memory first, falls through to disk only for NotCached, and records disk hits or misses in memory. — [crates/rspack_core/src/new_cache/cache.rs#L45-76](https://github.com/web-infra-dev/rspack/blob/179a0934f3091463419827fc2767af07b2fd38ed/crates/rspack_core/src/new_cache/cache.rs#L45-L76) [crates/rspack_core/src/new_cache/cache.rs#L142-168](https://github.com/web-infra-dev/rspack/blob/179a0934f3091463419827fc2767af07b2fd38ed/crates/rspack_core/src/new_cache/cache.rs#L142-L168)
- Asset output strips filename queries, joins the target with the configured output path, compares existing content when configured, writes through output_filesystem, and calls asset_emitted with source and target metadata. — [crates/rspack_core/src/compiler/mod.rs#L495-511](https://github.com/web-infra-dev/rspack/blob/179a0934f3091463419827fc2767af07b2fd38ed/crates/rspack_core/src/compiler/mod.rs#L495-L511) [crates/rspack_core/src/compiler/mod.rs#L527-573](https://github.com/web-infra-dev/rspack/blob/179a0934f3091463419827fc2767af07b2fd38ed/crates/rspack_core/src/compiler/mod.rs#L527-L573)

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)
