Size Limit
Set a compressed size budget for the JavaScript shipped by an article or product template.
Community support
Upvotes come from SearchEngineAnswer members. GitHub stars and reader reviews are counted separately.
Claim this tool if you maintain it.
- Best for
- Performance
- Setup required
- Add the CLI and its file plugin as development dependencies in a Node.js project that already builds the JavaScript delivered to browsers. Point the check at the generated asset.
- Costs to check
- The MIT-licensed CLI runs locally. Automated checks use your existing CI minutes and need no paid reporting service.
- License in catalog
- MIT
Project screenshot
GitHub repository
- GitHub stars
- 7,051
- Forks
- 1,747
- Last push
- 2026-11-10
- Primary language
- JavaScript
GitHub snapshot from . Stars count GitHub bookmarks. Reader ratings appear separately below.
How to install Size Limit
-
Open the project that produces the browser asset. Use a Node.js version supported by the installed Size Limit release. This evaluation used Node.js 26 and Size Limit 14.3.0.
npm install --save-dev size-limit @size-limit/file npm pkg set 'scripts.size=size-limit' npm run size - Install Size Limit and the file plugin. Build the site and check which generated file the landing template actually requests.
- Add a .size-limit.json file with the target asset and its maximum size. Add an npm script that invokes Size Limit, then commit the lockfile and budget together.
First tutorial for Size Limit
-
In a disposable folder, create dist/article.js with a short export statement and set a 100-byte limit for the file. Run the size check and write down the reported Brotli size.
[ { "path": "dist/article.js", "limit": "100 B" } ] - Append varied test text to the same file and rerun the check. Confirm the measured size exceeds the ceiling and the command exits with status 1. Remove the test data before going back to the real build.
- Choose a ceiling for your actual generated asset based on the current baseline. Run the same check after the build in CI and review the measured change if a pull request crosses the budget.
In the November 25 local fixture, the same 100-byte limit passed at 42 bytes and failed at 1.11 kB after adding test data. The fixture measures a single synthetic file.
Where Size Limit fits
Size Limit fits teams that can identify the files served by a template and want a check that fails a build when a measured file exceeds an agreed budget.
- When to choose another tool
- Choose a browser trace when the first question is which script delayed rendering or how long it blocked the main thread. Use field performance data when you need evidence about real visits.
- First evaluation
- Run the file plugin against one generated article asset. Set a small test ceiling above the first measurement, add enough varied test text to increase its compressed size, and check for a failing exit status.
- How to interpret the result
- Brotli size is a reproducible build measurement. Real transfers depend on the headers and compression your CDN sends. Execution cost and page responsiveness require their own checks.
Reviews and discussion
Reader reviews
Be the first to share your experience with this tool.
Discussion
Ask a question or share a setup tip.
Flag an outdated detail
Include the field that needs updating and a source link. Copy your draft, then use the corrections policy to contact the editorial team.
Write a review or join the discussion