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.
Requirements
Rsdoctor 2.0 requires Node.js ^20.19.0 || >=22.12.0 and Rspack 2.0 or later. If your project uses Rspack 1.x or webpack, use Rsdoctor 1.x instead.
How to use
- Install
@rsdoctor/core:
To upgrade from Rsdoctor 1.x, see the Rsdoctor 2.0 migration guide.
- Register
RsdoctorRspackPluginin the Rspack plugins option. Rsdoctor 2.0 packages are ESM-only, so use an ESM config and import:
rspack.config.mjs
- Set
RSDOCTOR=truewhen running Rspack:
On Windows, use cross-env to set environment variables:
After the build, Rsdoctor opens the analysis page. See the Rsdoctor 2.0 quick start for more details.

