-
-
Notifications
You must be signed in to change notification settings - Fork 767
Description
System Info
System:
OS: macOS (Darwin 25.2.0)
CPU: ARM64 (Apple Silicon)
Binaries:
Node: v24.12.0
npm: 11.10.0
NPM packages:
@rspack/cli: ^1.7.6
@rspack/core: ^1.7.6
Details
When using experiments.cache with type: 'persistent', switching between rspack build and rspack serve using the same config file causes the entire persistent cache to be invalidated and rewritten. No module-level build artifacts are reused, even though the config file, loaders, and source files are identical.
Partial cache validation is supported in Webpack 5's filesystem cache and we currently benefit a great deal from it. This is a blocker for a workflow we rely on in our large codebase: CI runs rspack build to produce a warm persistent cache, and that cache is shipped to other environments such as remote developer environments so developers benefit from it on their first rspack serve cold start.
Reproduce link
https://github.com/Armine-i/rspack-repro/tree/mina-repro
Reproduce Steps
- Run
rspack build -c rspack/rspack.config.ts: cache is created under a single hash folder - Run
rspack serve -c rspack/rspack.config.ts: the same hash folder's contents are fully invalidated and rewritten - Run
rspack build -c rspack/rspack.config.tsagain: fully invalidated and rewritten again
Each switch between build and serve produces a cache miss despite no source files or config changing.