Rspack will cache snapshots and intermediate products during the build process and use them in the next build to improve the speed of the build. Rspack will perform caching operations in the following process:
At this stage, Rspack will cache the results of module resolve requests and generate snapshots. When rebuilding, it will directly reuse valid snapshots to obtain results. For more snapshot configurations, refer to snapshot.resolve.
At this stage, Rspack will cache the results of module build and generate snapshots. When rebuilding, it will directly reuse valid snapshots to obtain results. For more snapshot configurations, refer to snapshot.module.
At this stage, Rspack will cache the final code generated by the module, and if the module has not changed, it will directly reuse the generated code when rebuilding.
Rspack currently only supports memory cache, persistent cache is under planning, for more details refer to persistent-cache-support.
This configuration currently only supports setting whether to enable caching.
boolean
false
, development mode is true
You can disable the cache directly in rspack.config.js
: