Bundle analysis is a crucial process that helps you understand your app's performance bottlenecks and identify opportunities for optimization. By analyzing your bundle, you can gain insights into bundle size and composition, module dependencies, duplicate modules, and compilation time. We recommend using Rsdoctor for bundle analysis, though you can also check our alternative tools section for other options.
Rsdoctor provides comprehensive visualization of the build process, offering detailed insights into compilation time, compilation transformations, module dependencies, duplicate modules, and bundle size analysis.
Please do not use Rsdoctor in production version.
The process.env.RSDOCTOR
is used to conditionally enable the plugin just for the development environment.
Initialize the plugin in your bundler configuration:
Use the RSDOCTOR
environment variable when running the build:
For better analysis results, it's recommended to run a single platform build using the --platform
option:
This helps to get more focused and accurate bundle analysis for each platform.
After running the above commands, when the build is completed, it will open the build analysis page. For complete features, please refer to Rsdoctor documentation.
The RsdoctorPlugin
plugin provides several options to customize the build analysis. Read more about it here.