Bundle size for every commit, free
Bundle Size by Utilarium keeps the size of your web build. Upload it from your CI. See how each commit changed it, and which file grew.
- 2sizes for each file: raw and gzip
- 1 linein your CI sends it, with Node 20 or later
- 100uploads kept for each flag
- 20repos for each person, free
What you get
The size, every commit
The gzip and raw total of each flag, and a chart of the last builds on the default branch.
What grew since the base
For each commit, the files that are new, gone, bigger or smaller than in the base build. The biggest growth is first.
Read more in the docsSize of each route
The size of each page, with the script and style files it loads. You see which page got heavy.
Budgets
Set a gzip limit and a growth limit for each flag. The upload answer says if the build is inside them.
Read more in the docsA badge
A badge for your README with the gzip size, only when you turn it on.
Read more in the docsPR status check: planned
A check on each pull request needs a GitHub App. It is not ready. Use --strict in your CI to fail a build over its budget.
Upload in 3 steps
- Sign in, add your repo (an owner and a name, such as
acme/widgets) and make an upload token. The token is shown once. Save it as a secret of your CI namedBUNDLE_SIZE_TOKEN. - Build your project with Vite. The build directory is
distby default. - Send the sizes after your build with one line, once for each flag. No install and no account: it needs only Node 20 or later.
BUNDLE_SIZE_TOKEN=bsz_... npx -y https://bundle-size.utilarium.app/cli.tgz \
--dir dist --flag webcurl -fsSL https://bundle-size.utilarium.app/upload.mjs | BUNDLE_SIZE_TOKEN=bsz_... node - \
--dir dist --flag web# .github/workflows/bundle-size.yml
name: bundle-size
on: [push, pull_request]
jobs:
size:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
- run: npm ci && npm run build
- name: Upload the size
run: npx -y https://bundle-size.utilarium.app/cli.tgz --dir dist --flag web --strict
env:
BUNDLE_SIZE_TOKEN: ${{ secrets.BUNDLE_SIZE_TOKEN }}The uploader prints the address of the commit page. A second upload for the same commit and flag replaces the first, so a retried CI job is safe. It finds the commit and the branch in git and in your CI, and it never fails your build unless you pass --strict. The docs show the JSON API.
Made for monorepos
Each project is a flag. A flag that a commit did not touch keeps its last upload, so the size of your repo is always the sum of every project. One upload for one project does not make the others vanish.
See your first build size in minutes
Add a repo, make a token and paste one line into your CI. Your next commit shows up with its size and its change.