features
- Type: RsdoctorRspackPluginFeatures | Array<keyof RsdoctorRspackPluginFeatures>
- Optional:
true - Default:
['loader', 'plugins', 'bundle']
Configuration description
The features attribute is used for analysis feature toggles, and the specific functional items are as follows:
- loader: Loader time consumption and code compilation change analysis, enabled by default.
- plugins: Plugin calls and time consumption analysis, enabled by default.
- bundle: Build artifact analysis, enabled by default.
- resolver: Resolver analysis, disabled by default.
- treeShaking: Tree-shaking side-effect analysis, disabled by default. This feature is unavailable when
output.modeis'brief'. - lite: Enables lite mode. Both
features: { lite: true }andfeatures: ['lite']are supported. When enabled, lite mode forces the report code type tonoAssetsAndModuleSource, overriding otheroutput.reportCodeTypevalues. The only exception is an explicitly configurednoCodevalue, which takes precedence.noAssetsAndModuleSourceomits module source and asset code while retaining bundled module code. Lite mode is disabled by default.
By default, loader, plugins, and bundle are enabled; resolver, treeShaking, and lite are disabled.
Types
- If you set
featuresas an array type, the plugin will only enable the features you define in thefeaturesarray. - If you set
featuresas an object, omitted features keep their defaults. Set a feature totrueto enable it orfalseto disable it.
Examples
Notes
Tip
If an "out of memory" error occurs, you can try the following:
- Set
output.reportCodeTypetonoCodeornoAssetsAndModuleSource. - Increase the node memory limit, for example: NODE_OPTIONS=--max-old-space-size=8096.
- Reason: The build may exceed the memory limit when it stores source code. Reducing the code data included in the report can lower memory usage.
- Difference:
noCodeomits all code, whilenoAssetsAndModuleSourceomits asset code and module source code.
RsdoctorRspackPluginFeatures
features type:

