performance
performance.buildCache
performance.buildCache
- Type:
- Default:
false
Enables Rsbuild persistent build cache for Rstest test builds.
Tip
Rspack's persistent cache is still experimental and may change across versions, so Rstest does not enable performance.buildCache by default.
rstest.config.ts
When enabled, Rstest applies a few Rstest-specific defaults to keep the cache stable across runs:
cacheDirectorydefaults to thenode_modules/.cache/rstest-<project-name>base directory under the active project root. Rspack stores the cache data under<cacheDirectory>/<cache.name>, so projects that share the same root still get isolated caches.cacheDigestautomatically includes Rstest runtime inputs such as command, environment name, browser-vs-node mode.buildDependenciesautomatically includes the active Rstest config file, project config files, and discoveredtsconfigpaths when available.
You can customize these fields to override or extend the defaults:
cacheDirectory: override. When you provide it, Rstest uses it as the base directory; the final cache location is<cacheDirectory>/<cache.name>.cacheDigest: extend. Rstest keeps its own runtime digest entries and appends your custom values after them.buildDependencies: extend. Rstest keeps its own dependency files and appends your custom files after resolving relative paths from the active config file directory.
For example:
rstest.config.ts