Rsdoctor is a build analyzer tailored for the Rspack ecosystem.
Rsdoctor is committed to being a one-stop, intelligent build analyzer that makes the build process transparent, predictable, and optimizable through visualization and smart analysis, helping development teams precisely identify bottlenecks, optimize performance, and improve engineering quality.
If you need to debug the build outputs or build process, you can use Rsdoctor for troubleshooting.
In an Rspack project, you can enable Rsdoctor by following these steps:
@rsdoctor/rspack-plugin plugin:npm add @rsdoctor/rspack-plugin -DRsdoctorRspackPlugin plugin in the plugins option of Rspack:import { RsdoctorRspackPlugin } from '@rsdoctor/rspack-plugin';
export default {
// ...
plugins: [
// Register the plugin only when RSDOCTOR is true, as the plugin increases build time
process.env.RSDOCTOR &&
new RsdoctorRspackPlugin({
// plugin options
}),
],
};RSDOCTOR=true variable before the build command:# dev
RSDOCTOR=true rspack serve
# build
RSDOCTOR=true rspack buildAs Windows does not support the above usage, you can also use cross-env to set environment variables. This ensures compatibility across different systems:
# dev
cross-env RSDOCTOR=true rspack serve
# build
cross-env RSDOCTOR=true rspack buildRsdoctor will open the build analysis page after the build is complete. For complete features, please refer to Rsdoctor documentation.
See the Options documentation of Rsdoctor to configure the options of the RsdoctorRspackPlugin.
See the Rsdoctor features to learn about all the features of Rsdoctor.