Performance budget for JavaScript: fail CI when a change makes your bundle too big or slow
open sourceMITfree
Size Limit is a performance budget tool for JavaScript by Andrey Sitnik, built at Evil Martians. It runs on every commit in CI, works out what your JS really costs users (all dependencies and polyfills included, with tree-shaking and ES modules) and fails when the cost goes over the limit you set, either in bytes (Brotli, Gzip or uncompressed) or in the time a browser takes to download and run it. Plugins and presets fit apps with their own bundler and small libraries alike, bundling with webpack, esbuild or Rolldown, and --why shows which dependencies make up the size, through Statoscope.
Problems it solves
- fail CI when a pull request adds a huge dependency to my JavaScript bundle
- keep my npm library's bundle size under a budget
- see why my JS bundle is as big as it is
Features
- size limits in bytes, with Brotli, Gzip or no compression
- time limits for downloading and running JS in headless Chrome
- webpack, esbuild and Rolldown plugins
- --why analysis of what makes up the size
- GitHub Action that comments size changes on pull requests
Limitations
- Needs Node.js 22.19+, 24.5+ or 26+1
