CodeVetter
← All unpacks
CodeVetter · Repo Unpack evidence

web-infra-dev/rspack

Scanned commit 179a0934f3 dated 2026-10-01 — last upstream commit. Generated by codevetter 1.15.0 on 2026-10-02.

github.com/web-infra-dev/rspack ↗ · 3997 files · 13.9 MB · scan capped

Rspack English | 简体中文 Rspack is a fast Rust-based bundler for the web.

Deep analysis by cli:codex via the codex CLI on 2026-10-02 (485s) — every claim below links to its cited source files. Source inspection; upstream code and tests were not executed.

Overview

Rspack is a Rust-based web bundler for application developers and tool authors who want a webpack-compatible JavaScript API, plugin hooks, and loader ecosystem. Its TypeScript layer handles configuration and developer-facing APIs while a Node-API binding delegates compilation, graph processing, and asset generation to Rust. The inspected implementation distinguishes persistent build caching from incremental recovery within a compiler lifecycle, and exposes build, development-server, and preview commands. This brief describes source at commit 179a0934f3091463419827fc2767af07b2fd38ed; inspection was bounded and no repository code was executed.

System map

Rspack has three cooperating runtime layers: the JavaScript API, the native binding, and the Rust compilation engine. Compiler and Compilation have different lifetimes, while filesystem adapters and callback bridges connect the layers. Distribution includes npm packages, native bindings, and WASM variants rather than a single hosted service. The documentation website and repository automation have separate build responsibilities.

Feature catalog

The inspected public surface includes programmatic compilation, CLI building, live development, and static preview. Configuration controls target environments, loaders, optimization, output, caching, and watch behavior. Public plugin namespaces expose federation, runtime, and chunk-loading capabilities. Compatibility has documented exceptions, so the webpack-shaped API does not establish universal feature parity.

Data flow

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.

Behavior traces

Four concrete source traces were followed: CLI startup and build, asset emission, watch rebuild, and experimental filesystem-cache persistence. Their order crosses JavaScript callbacks and asynchronous Rust execution. Several lifecycle hooks can suppress output, request another pass, or delay shutdown. The traces describe implemented control flow without asserting successful execution.

Testing signals

Tests and CI were inspected, not executed; no passing result is claimed. The inspected harness uses Rstest through rs test, Playwright integration for browser behavior, TypeScript checks, and Rust tests. It includes explicit exclusions and opt-in compatibility suites that limit what a default run establishes. This was bounded source inspection, not exhaustive coverage analysis.

Risk map

The principal sensitive boundaries are executable build inputs, output deletion/writes, remote-resource fetching, and native-backed JavaScript lifetimes. Source contains protective conditions as well as compatibility limitations. The observations below are not confirmed vulnerabilities, and the single resource-exhaustion concern is explicitly a hypothesis. Partial inspection does not establish the absence of other guards or tests.

Extension points

Rspack offers extension seams at the CLI, configuration, compiler hooks, native plugins, module-type parsing, loaders, filesystems, and cache services. JavaScript and Rust plugin models meet through staged hook registrations. New behavior should attach to the owning lifecycle rather than bypass its boundaries. The inspected factories and registries make these integration points concrete.

Contributor handoff

Use this brief as a source map for the pinned commit, then recheck the exact subsystem before editing. Tests and CI were inspected, not executed, and the bounded inventory does not establish exhaustive coverage or passing behavior. Repository conventions require building consumed artifacts before validation and reusing existing test harnesses. Cache ownership, native lifetimes, and hook ordering deserve focused attention because changes cross runtime boundaries.

Languages

LanguageFilesShare of source
JavaScript1387573%
TypeScript349618%
Rust13847%
JSON909docs/config
CSS891docs/config
Markdown500docs/config
TOML1121%
HTML101docs/config

Start reading here

Probable source entrypoint: Cargo.toml — inferred from the directory tree and manifest, not the upstream docs.

Source roots

crates/ (1317 files) packages/ (535 files)

Source layout — crates/

PathFiles
crates/css-module-lexer/20
crates/node_binding/8
crates/rspack/22
crates/rspack_allocator/2
crates/rspack_binding_api/135
crates/rspack_binding_build/3
crates/rspack_binding_builder/3

Repository structure

Top-level pathFiles
crates/1317
tests/1316
website/569
packages/535
xtask/90
.github/46
.agents/45
examples/18

Docs found: AGENTS.mdCONTRIBUTING.mdREADME.md

Package

Cargo.toml — v0.102.8, 0 declared dependencies.

CI & config entrypoints

Structural health signals

Average score 5.8/10 across 96 analyzed source files; 75 hotspots surfaced.

These are deterministic review leads — size, churn, and structural signals — not proof of a bug in this project.

Recent history