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
This guide applies to Rsbuild v2.2.6 and later. For Rsbuild v1, see the v1 documentation.
In an Rsbuild 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, Rsbuild 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, manually register the plugin:

