Rspack is a Rust-based JavaScript bundler with a webpack-compatible API.
Before testing changed code, build the artifacts those tests consume using the development commands.
- Rust: Do not add new Rust tests in ordinary changes. New cases belong in dedicated test crates; do not add inline
#[test]functions or crate-local unit tests. - JavaScript: Reuse existing runners and add cases under
tests/rspack-test/{type}Cases/. Do not add top-level or suite-leveltest.jsrunners. Harness-required files inside a case, such ashookCases/**/test.js, are allowed.
- Follow .github/PULL_REQUEST_TEMPLATE.md.
- Update relevant English and Chinese docs when public behavior or APIs change.
- Concurrency: read before changing parallel execution or task scheduling.
- Cache and Incremental: read before changing either cache backend or shared cache dependencies.
- Rspack Sources: read before changing or heavily using
crates/rspack_sources. - Binding: read when changing Rust/JavaScript ownership, lifetimes, or hook bridging.
- Rust cloning and error handling: read the relevant rules before adding
Cloneimplementations or changing Rust error handling. - Architecture and project layout: compilation flow and subsystem locations.
- API design: public contracts and webpack compatibility.
- Code style, common patterns, and glossary: conventions and terminology.
- Testing and debugging: harness and debugger details.