Analyze bundle size, build metrics, and optimization recommendations. Part of the DevTools Surf developer suite. Browse more tools in the DevOps / CI-CD collection.
Use Cases
Identify which npm packages contribute most to bundle size
Find duplicate dependencies that could be deduplicated
Detect code that bypasses tree-shaking due to side effects
Benchmark bundle size before and after refactoring a dependency
Tips
Paste your webpack-bundle-analyzer or Rollup stats JSON to get per-module size breakdowns and tree-shaking suggestions
The 'duplicate module' detector identifies packages imported multiple times with different versions — a common source of bundle bloat
Check the 'dynamic import' recommendations: code-splitting the identified heavy routes can reduce initial load time by 40%+ in large SPAs
Fun Facts
webpack was first released in 2012 by Tobias Koppers. It introduced the concept of treating every asset (JS, CSS, images, fonts) as a module — a shift that enabled the modern JavaScript bundling ecosystem.
The average JavaScript bundle size for top-1000 websites grew from 180KB in 2012 to over 500KB in 2023, despite advances in compression and tree-shaking — primarily driven by larger frameworks and more third-party scripts.
Google's Lighthouse tool introduced the Performance budget concept in 2019: setting maximum bundle sizes and flagging violations in CI. This formalized build optimization as part of the deployment pipeline.
FAQ
What format should my input be in?
Webpack stats JSON (generated with webpack --json), Rollup bundle analysis JSON, or Vite's vite-bundle-visualizer output. The analyzer auto-detects the format from the structure.
What is tree shaking?
Tree shaking removes unused exports from ES modules during bundling. It only works with static import/export syntax (not CommonJS require). Packages with sideEffects: false in package.json enable more aggressive tree shaking.
What is a good bundle size target?
Google's PRPL pattern targets under 100KB compressed for the critical path. Total JavaScript under 300KB compressed is a reasonable target for most apps; above 1MB typically causes measurable performance issues on mid-range mobile devices.