Services

Cloudflare Artifact Budgets


Cloudflare artifact performance budgets

Use the Cloudflare artifact budget gate after Cloudflare-oriented builds have already produced deploy outputs. It inspects files in place and does not run a build.

bash
1
mise exec -- node tools/scripts/check-cloudflare-artifact-budgets.mjs

Useful options:

bash
1
mise exec -- node tools/scripts/check-cloudflare-artifact-budgets.mjs --app www
2
mise exec -- node tools/scripts/check-cloudflare-artifact-budgets.mjs --app manager
3
mise exec -- node tools/scripts/check-cloudflare-artifact-budgets.mjs --allow-missing --dry-run

The default config is tools/cloudflare-artifact-budgets.json. It covers:

  • apps/www/.next-build and apps/www/.open-next
  • apps/manager/build
  • OpenNext Worker app outputs under apps/*/.open-next

The gate reports these budget metrics per app:

  • javascriptGzip — total gzip size of JavaScript-like files (.js, .mjs)
  • assetsRaw — total raw size of deploy asset file types
  • largestAssetRaw — largest individual asset file
  • workerRaw — raw size of Worker files, primarily .open-next/worker/**

If a budget fails, the command exits non-zero and prints the app, metric, measured size, and configured limit. Treat config changes as intentional budget changes and review them with the same care as application changes.