The content of this section is derived from the content of the following links and is subject to the CC BY 4.0 license.
The following contents can be assumed to be the result of modifications and deletions based on the original contents if not specifically stated.
Generate packaging information that can be used to analyze module dependencies and optimize compilation speed.
@rspack/cli, rspack build --json stats.json.stats.toJson(options)、stats.toString(options).boolean | string | Object{"preset":"errors-warnings","timings":true}| Preset | Description |
|---|---|
'normal' (true) |
Output by default value of stats options |
'none' (false) |
Output nothing |
'verbose' |
Output everything |
'errors-only' |
Output only error-related information |
'errors-warnings' |
Output only error and warning related information |
You can specify exactly which packing information to output, all the following fields are optional.
booleantrueTells stats whether to show the asset information.
booleantrueTells stats whether to show the chunk information.
booleantrueTells stats whether to show the module information.
booleantrueTells stats whether to show the entrypoints information.
booleantrueTells stats whether to add information about the namedChunkGroups.
booleantrueTells stats to add information about the reasons of why modules are included.
booleantrueTells stats whether to add information about the hash of the compilation.
booleantrueTells stats whether to display the errors.
booleantrueAdd errors count.
booleantrueTells stats to add warnings.
booleantrueAdd warnings count.
booleanfalseTells stats whether to output in the different colors.
It is set to true by default when executing rspack build on environments with color support.
booleantrueTells stats to add information about the Rspack version used.
booleantrueTells stats to show the publicPath.
booleantrueTells stats to show the outputPath.
booleantrueTells stats whether to add information about the built modules to information about the chunk.
booleanfalseTells stats to display chunk parents, children and siblings.
booleanfalseTells stats to add IDs of modules and chunks.
booleantrueTells stats to add the timing information.
booleantrueTells stats whether to add the build date and the build time information. Set stats.builtAt to false to hide it.
booleantrueTells stats whether to add information about assets inside modules. Set stats.moduleAssets to false to hide it.
number15Tells stats how many items of modules should be displayed (groups will be collapsed to fit this space).
booleantrueTells stats whether to add information about modules nested in other modules (like with module concatenation).
booleanfalseTells stats to add the source code of modules.
'info' | 'none' | 'error' | 'warn' | 'log' | 'verbose' | booleanTells stats whether to add logging output.
Array<string | RegExp | function (name) => boolean>Tells stats to include the debug information of the specified loggers such as Plugins or Loaders. When stats.logging is set to false, stats.loggingDebug option is ignored.
booleanEnable stack traces in the logging output for errors, warnings and traces. Set stats.loggingTrace to hide the trace.
booleanTells stats whether to add information about the childCompiler.
booleanundefinedControlling whether all stats options are output.
booleanundefinedOutput according to preset values.
If you want to use the preset output behavior but want to output more or less of individual fields, you can customize the output behavior of the fields after specifying preset or all.
For example, only the error and the reason why the module was introduced are output.