Overview - Bundle Analysis (original) (raw)

Bundle Analysis helps improve your application's performance, bandwidth usage, and load times by letting you know if what you’re about to merge will cause any performance regressions. It will allow you to explore all of the modules in your bundle and determine where you might be able to streamline your bundle size as well as find areas of concern.

# Post comment if there are changes in bundle size of any size  
comment:  
     require_bundle_changes: True  
       
# Post comment if there are changes in bundle size exceeding 1Kb  
comment:  
     require_bundle_changes: True  
     bundle_change_threshold: "1Kb"  
       
# Post comment if there are changes in bundle size increases more than 1Mb  
comment:  
     require_bundle_changes: "bundle_increase"  
     bundle_change_threshold: "1Mb"  

📘

Requiring changes are for posting the comment the 1st time. If it was already posted Codecov will always update the comment. Editing a comment doesn't send a new email to subscribers of the pull request.

# Post informational status (never fails) with threshold of 5%  
# This is the default configuration  
bundle_analysis:  
    warning_threshold: "5%"  
  status: "informational"  
    
# Disable commit status  
bundle_analysis:  
  status: False  
    
# Post commit status that will fail if change is larger than threshold of 10MB  
bundle_analysis:  
  warning_threshold: "10MB"  
  status: True  
    

To use Bundle Analysis, users can opt for a bundler plugin setup with current support for Rollup, Vite, and Webpack. To get started all you need to do is:

Framework specific guides for those frameworks can be found below:

If you're looking to further configure your plugin, you can check out more specific bundle configuration options in our plugin config docs.

Check out our Environment Specific Requirements for some potential fixes.