Size Limit is a JavaScript performance budget tool that measures the real cost of your JavaScript bundle and prevents regressions by enforcing limits in CI. It calculates not just raw bundle size, but also download and execution time under configurable network conditions, giving a more realistic sense of what users experience. The tool is modular: it offers a CLI and multiple plugins (file, webpack, time) plus presets tailored to different use cases, from big single-page apps to small npm libraries. When integrated with GitHub Actions, CircleCI, or other CI systems, it runs on every commit or pull request, failing the pipeline if a change exceeds the configured budget. It can also annotate pull requests with comments that highlight how the bundle changed, making performance regressions visible to reviewers early. With the --why flag, size-limit can analyze what contributes most to bundle size and show a dependency breakdown (using Statoscope).
Features
- CI-friendly performance budget tool that fails builds when bundle cost exceeds thresholds
- Supports ES modules, tree-shaking and includes all dependencies and polyfills in its calculations
- Multiple plugins and presets for apps, big libraries and small libraries with different build setups
- Can estimate real-world download and execution time, with configurable network speed and latency
- GitHub Action and other CI examples that post bundle size diffs as comments on pull requests
- --why analysis mode using Statoscope to explain where bundle size comes from and what to optimize