Use Rsdoctor
Rsdoctor is a build analysis tool for the Rspack ecosystem. It visualizes the build process and output to help developers investigate build issues and identify performance bottlenecks. It also provides build data to agents for automated diagnosis and optimization of JavaScript programs.
Quick start
In an Rslib project, enable Rsdoctor as follows:
- Install the Rsdoctor plugin:
To upgrade from Rsdoctor 1.x, see the Rsdoctor 2.0 migration guide.
- Set the
RSDOCTOR=trueenvironment variable before running the CLI command:
Because Windows does not support this syntax, you can use cross-env to set environment variables across different systems:
After running these scripts, Rslib automatically registers the Rsdoctor plugin and opens the build analysis page when the build finishes. See the Rsdoctor documentation for all features.
Options
To configure the options exposed by the Rsdoctor plugin, you can manually register the plugin:
