Rsdoctor is a build analyzer tailored for the Rspack ecosystem.
Rsdoctor aims to be a one-stop, intelligent build analyzer that makes the build process transparent, predictable, and optimizable through visualization and smart analysis, helping teams pinpoint bottlenecks, improve performance, and raise engineering quality.
Use Rsdoctor to debug build outputs or the build process.
In an Rsbuild project, enable Rsdoctor as follows:
npm add @rsdoctor/rspack-plugin -DRSDOCTOR=true environment variable before running the CLI command:{
"scripts": {
"dev:rsdoctor": "RSDOCTOR=true rsbuild dev",
"build:rsdoctor": "RSDOCTOR=true rsbuild build"
}
}Because Windows does not support this syntax, you can use cross-env to set environment variables across different systems:
{
"scripts": {
"dev:rsdoctor": "cross-env RSDOCTOR=true rsbuild dev",
"build:rsdoctor": "cross-env RSDOCTOR=true rsbuild build"
},
"devDependencies": {
"cross-env": "^7.0.0"
}
}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.
To configure the options exposed by the Rsdoctor plugin, manually register the plugin:
import { RsdoctorRspackPlugin } from '@rsdoctor/rspack-plugin';
export default {
tools: {
rspack: {
plugins: [
process.env.RSDOCTOR === 'true' &&
new RsdoctorRspackPlugin({
// plugin options
}),
],
},
},
};