{"id":13402208,"url":"https://github.com/siddharthkp/bundlesize","last_synced_at":"2025-05-14T07:07:55.218Z","repository":{"id":37317643,"uuid":"95533278","full_name":"siddharthkp/bundlesize","owner":"siddharthkp","description":"Keep your bundle size in check","archived":false,"fork":false,"pushed_at":"2025-01-15T06:41:27.000Z","size":2048,"stargazers_count":4481,"open_issues_count":85,"forks_count":181,"subscribers_count":31,"default_branch":"master","last_synced_at":"2025-05-07T06:59:03.993Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/siddharthkp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":"roadmap.md","authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"siddharthkp","open_collective":"bundlesize"}},"created_at":"2017-06-27T08:01:41.000Z","updated_at":"2025-04-14T17:49:10.000Z","dependencies_parsed_at":"2024-01-03T02:23:34.426Z","dependency_job_id":"ccee1be3-a08d-4558-ae36-cac28cf86ad4","html_url":"https://github.com/siddharthkp/bundlesize","commit_stats":{"total_commits":361,"total_committers":55,"mean_commits":"6.5636363636363635","dds":"0.38227146814404434","last_synced_commit":"fc5d2b85bb83c5d28b5b0a74c08ee65e62a01bd0"},"previous_names":[],"tags_count":48,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siddharthkp%2Fbundlesize","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siddharthkp%2Fbundlesize/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siddharthkp%2Fbundlesize/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siddharthkp%2Fbundlesize/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/siddharthkp","download_url":"https://codeload.github.com/siddharthkp/bundlesize/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254092650,"owners_count":22013290,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-30T19:01:12.954Z","updated_at":"2025-05-14T07:07:55.108Z","avatar_url":"https://github.com/siddharthkp.png","language":"JavaScript","funding_links":["https://github.com/sponsors/siddharthkp","https://opencollective.com/bundlesize"],"categories":["JavaScript","CI/CD","Build Tools to set up performance budget","Package management and publishing","Bundle Analyzer","📦 Legacy \u0026 Inactive Projects"],"sub_categories":["Dependency Management","Server-rendered React","Meetups"],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://cdn.rawgit.com/siddharthkp/bundlesize/master/art/logo.png\" height=\"200px\"\u003e\n  \u003cbr\u003e\u003cbr\u003e\n  \u003cb\u003eKeep your bundle size in check\u003c/b\u003e\n  \u003cbr\u003e\n\u003c/p\u003e\n\n\u0026nbsp;\n\n[![Build Status](https://travis-ci.org/siddharthkp/bundlesize.svg?branch=master)](https://travis-ci.org/siddharthkp/bundlesize)\n[![NPM Version](https://img.shields.io/npm/v/bundlesize.svg)](https://npmjs.org/package/bundlesize)\n[![NPM Downloads](https://img.shields.io/npm/dm/bundlesize.svg?style=flat)](https://www.npmjs.com/package/bundlesize)\n\u0026nbsp;\n\n#### Setup\n\n```sh\nnpm install bundlesize --save-dev\n\n# or\n\nyarn add bundlesize --dev\n```\n\n\u0026nbsp;\n\n#### Usage\n\n\u0026nbsp;\n\nAdd it to your scripts in `package.json`\n\n```json\n\"scripts\": {\n  \"test\": \"bundlesize\"\n}\n```\n\nOr you can use it with `npx` from [NPM 5.2+](https://medium.com/@maybekatz/introducing-npx-an-npm-package-runner-55f7d4bd282b).\n\n```sh\nnpx bundlesize\n```\n\n\u0026nbsp;\n\n#### Configuration\n\n\u0026nbsp;\n\n`bundlesize` accepts an array of files to check.\n\n```json\n[\n  {\n    \"path\": \"./build/vendor.js\",\n    \"maxSize\": \"30 kB\"\n  },\n  {\n    \"path\": \"./build/chunk-*.js\",\n    \"maxSize\": \"10 kB\"\n  }\n]\n```\n\n\u0026nbsp;\n\nYou can keep this array either in\n\n1. `package.json`\n\n   ```json\n   {\n     \"name\": \"your cool library\",\n     \"version\": \"1.1.2\",\n     \"bundlesize\": [\n       {\n         \"path\": \"./build/vendor.js\",\n         \"maxSize\": \"3 kB\"\n       }\n     ]\n   }\n   ```\n\n   or in a separate file\n\n2. `bundlesize.config.json`\n\n   Format:\n\n   ```json\n   {\n     \"files\": [\n       {\n         \"path\": \"./dist.js\",\n         \"maxSize\": \"3 kB\"\n       }\n     ]\n   }\n   ```\n\n   You can give a different file by using the `--config` flag:\n\n   ```\n   bundlesize --config configs/bundlesize.json\n   ```\n\n\u0026nbsp;\n\n#### Customisation\n\n\u0026nbsp;\n\n1. Fuzzy matching\n\n   If the names of your build files are not predictable, you can use the [glob pattern](https://github.com/isaacs/node-glob) to specify files.\n\n   This is common if you append a hash to the name or use a tool like create-react-app/nextjs.\n\n   ```json\n   {\n     \"files\": [\n       {\n         \"path\": \"build/**/main-*.js\",\n         \"maxSize\": \"5 kB\"\n       },\n       {\n         \"path\": \"build/**/*.chunk.js\",\n         \"maxSize\": \"50 kB\"\n       }\n     ]\n   }\n   ```\n\n   It will match multiple files if necessary and create a new row for each file.\n\n   \u0026nbsp;\n\n2. Compression options\n\n   By default, bundlesize `gzips` your build files before comparing.\n\n   If you are using `brotli` instead of gzip, you can specify that with each file:\n\n   ```json\n   {\n     \"files\": [\n       {\n         \"path\": \"./build/vendor.js\",\n         \"maxSize\": \"5 kB\",\n         \"compression\": \"brotli\"\n       }\n     ]\n   }\n   ```\n\n   If you do not use any compression before sending your files to the client, you can switch compression off:\n\n   ```json\n   {\n     \"files\": [\n       {\n         \"path\": \"./build/vendor.js\",\n         \"maxSize\": \"5 kB\",\n         \"compression\": \"none\"\n       }\n     ]\n   }\n   ```\n\n\u0026nbsp;\n\n#### Build status for GitHub\n\n\u0026nbsp;\n\nIf your repository is hosted on GitHub, you can set bundlesize up to create a \"check\" on every pull request.\n\n![build status](https://cdn.rawgit.com/siddharthkp/bundlesize/master/art/status.png)\n\nCurrently works with [Travis CI](https://travis-ci.org), [CircleCI](https://circleci.com/), [Wercker](http://www.wercker.com), and [Drone](http://readme.drone.io/).\n\n- [Authorize `bundlesize` for status access](https://github.com/login/oauth/authorize?scope=repo%3Astatus\u0026client_id=6756cb03a8d6528aca5a), copy the token provided.\n- Add this token as `BUNDLESIZE_GITHUB_TOKEN` as environment parameter in your CIs project settings.\n\n#### Using a different CI?\n\nYou will need to supply an additional 5 environment variables.\n\n- `CI_REPO_OWNER` given the repo `https://github.com/myusername/myrepo` would be `myusername`\n- `CI_REPO_NAME` given the repo `https://github.com/myusername/myrepo` would be `myrepo`\n- `CI_COMMIT_MESSAGE` the commit message\n- `CI_COMMIT_SHA` the SHA of the CI commit, in [Jenkins](https://jenkins.io/) you would use `${env.GIT_COMMIT}`\n- `CI=true` usually set automatically in CI environments \n\n(Ask me for help if you're stuck)\n\n\u0026nbsp;\n\n#### Usage with CLI\n\n\u0026nbsp;\n\nbundlesize can also be used without creating a configuration file. We do not recommend this approach and it might be deprecated in a future version.\n\n```sh\nbundlesize -f \"dist/*.js\" -s 20kB\n```\n\nFor more granular configuration, we recommend configuring it in the `package.json` (documented above).\n\n\u0026nbsp;\n\n#### Like it?\n\n:star: this repo\n\n\u0026nbsp;\n\n#### How to contribute?\n\n- [CONTRIBUTING.md](CONTRIBUTING.md)\n\n\u0026nbsp;\n\n#### Featured on [Totally tooling tips](https://www.youtube.com/watch?v=Da6VxdGU2Ig) and [Chrome Dev Summit](https://www.youtube.com/watch?v=_srJ7eHS3IM)!!\n\n\u003ca href=\"https://www.youtube.com/watch?v=Da6VxdGU2Ig\"\u003e\n  \u003cimg height=\"200px\" src=\"https://i.ytimg.com/vi/Da6VxdGU2Ig/hqdefault.jpg?sqp=-oaymwEXCNACELwBSFryq4qpAwkIARUAAIhCGAE=\u0026rs=AOn4CLAAfWzQIMvjH0TIzkAhi-114DIHPQ\"/\u003e\n\u003c/a\u003e\n\u003ca href=\"https://www.youtube.com/watch?v=_srJ7eHS3IM\"\u003e\n  \u003cimg height=\"200px\" src=\"https://cdn.rawgit.com/siddharthkp/bundlesize/master/art/chromedevsummit.png\"/\u003e\n\u003c/a\u003e\n\n\u0026nbsp;\n\n#### who uses bundlesize?\n\n- [bootstrap](https://github.com/twbs/bootstrap)\n- [lighthouse](https://github.com/GoogleChrome/lighthouse)\n- [styled-components](https://github.com/styled-components/styled-components)\n- [emotion](https://github.com/tkh44/emotion)\n- [glamorous](https://github.com/paypal/glamorous)\n- [Popper.js](https://github.com/FezVrasta/popper.js)\n- [react-apollo](https://github.com/apollographql/react-apollo)\n- [hyperapp](https://github.com/hyperapp/hyperapp)\n- [css-constructor](https://github.com/siddharthkp/css-constructor)\n- [redux-saga](https://github.com/redux-saga/redux-saga)\n- [micromodal](https://github.com/ghosh/micromodal)\n- [unistore](https://github.com/developit/unistore)\n- [ngxs](https://github.com/ngxs/store)\n\n\u0026nbsp;\n\n#### TODO\n\n- Work with other CI tools\n  - [AppVeyor](https://www.appveyor.com/) ([#234](https://github.com/siddharthkp/bundlesize/issues/234))\n- Automate setup (setting env_var)\n\n\u0026nbsp;\n\n#### similar projects\n\n- [BuildSize](https://buildsize.org/) - GitHub App, no manual configuration required\n- [travis-weigh-in](https://github.com/danvk/travis-weigh-in) - Uses Python rather than Node.js\n- [size-limit](https://github.com/ai/size-limit) - Uses webpack, builds your files for you.\n\n## Contributors\n\nThis project exists thanks to all the people who contribute. [[Contribute]](CONTRIBUTING.md).\n\u003ca href=\"graphs/contributors\"\u003e\u003cimg src=\"https://opencollective.com/bundlesize/contributors.svg?width=890\" /\u003e\u003c/a\u003e\n\n#### license\n\nMIT © [siddharthkp](https://github.com/siddharthkp)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsiddharthkp%2Fbundlesize","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsiddharthkp%2Fbundlesize","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsiddharthkp%2Fbundlesize/lists"}