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
false
Preset | Desciption |
---|---|
'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.
boolean
true
Tells stats whether to show the asset information.
boolean
true
Tells stats whether to show the chunk information.
boolean
true
Tells stats whether to show the module information.
boolean
true
Tells stats whether to show the entrypoints information.
boolean
true
Tells stats to add information about the reasons of why modules are included.
boolean
true
Tells stats whether to add information about the hash of the compilation.
boolean
true
Tells stats whether to display the errors.
boolean
true
Add errors count.
boolean
true
Tells stats to add warnings.
boolean
true
Add warnings count.
boolean
undefined
Controlling whether all stats options are output.
boolean
undefined
Output 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.
module.exports = {
// ...
stats: {
preset: 'errors-only',
reasons: true,
},
};