Interface: Performance
The Performance option is used to optimize the build-time and runtime performance.
Properties
buildCache?
optionalbuildCache?:boolean|BuildCache
Beta
Enable or configure persistent build cache.
Default Value
Remarks
This feature is experimental and may be changed in the future.
Examples
Enable persistent build cache.
Customize build cache.
chunkSplit?
optionalchunkSplit?:ChunkSplit|ChunkSplitBySize|ChunkSplitCustom
Performance.chunkSplit is used to configure the chunk splitting strategy.
Default Value
Unset, which bundles everything into one chunk (same as 'all-in-one').
Deprecated
Use the top-level Config.splitChunks option instead.
printFileSize?
optionalprintFileSize?:boolean|PrintFileSizeOptions
Whether to print the file sizes after production build.
Default Value
Remarks
See Rsbuild - performance.printFileSize for details.
Examples
If you don't want to print any information, you can disable it by setting printFileSize to false:
Set total to false to disable total size output.
Set detail to false to disable per-asset size output.
If you don't need to view the size of each static asset, you can set detail to false. In this case, only the total size will be output:
If you don't need to view the gzipped size, you can set compressed to false. This can save some gzip computation time for large projects:
To include only static assets that meet certain criteria, use a filter function with include.
If returned false, the static asset will be excluded and not included in the total size or detailed size.
only output static assets larger than 10kB:
To exclude static assets that meet certain criteria, use a filter function with exclude. If both include and exclude are set, exclude will take precedence.
Rspeedy defaults to excluding source map, license files, and .d.ts type files, as these files do not affect page load performance.
exclude .html files in addition to the default:
profile?
optionalprofile?:boolean
Whether to capture timing information in Lynx runtime integrations such as ReactLynx.
Remarks
A framework includes runtime information using console.profile when this
is enabled.
Default Value
true when DEBUG=lynx, otherwise undefined
Example
Enable profile.
- Frameworks like ReactLynx will include runtime information using
console.profile. - Rspeedy will emit
dist/stats.jsonafter build for bundle analysis compatibility.
removeConsole?
optionalremoveConsole?:boolean|ConsoleType[]
Whether to remove console.[methodName] in production build.
Default Value
Examples
- Remove all
consolemethods
- Remove specific
consolemethods