{"id":16323243,"url":"https://github.com/lironer/bundlemon","last_synced_at":"2025-05-16T05:04:17.590Z","repository":{"id":38417557,"uuid":"273470743","full_name":"LironEr/bundlemon","owner":"LironEr","description":"A free open-source tool that helps you to monitor your bundle size on every commit and alerts you on changes.","archived":false,"fork":false,"pushed_at":"2025-05-15T05:44:26.000Z","size":7170,"stargazers_count":117,"open_issues_count":3,"forks_count":9,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-05-15T06:33:16.603Z","etag":null,"topics":["bundle","bundlesize","github","hacktoberfest","monitor","size","webpack"],"latest_commit_sha":null,"homepage":"https://app.bundlemon.dev","language":"TypeScript","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/LironEr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"LironEr","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":"lironer","otechie":null,"lfx_crowdfunding":null,"custom":["https://www.paypal.com/donate?hosted_button_id=YZL6KM2UGB5ML"]}},"created_at":"2020-06-19T10:50:44.000Z","updated_at":"2025-05-15T05:41:12.000Z","dependencies_parsed_at":"2023-02-08T14:15:45.586Z","dependency_job_id":"8e5db0b3-b9c1-4cad-848c-fba3ea1f9ca2","html_url":"https://github.com/LironEr/bundlemon","commit_stats":{"total_commits":211,"total_committers":5,"mean_commits":42.2,"dds":"0.15165876777251186","last_synced_commit":"630584f8f834bf28299d616bf03ea18a2b85ac11"},"previous_names":[],"tags_count":41,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LironEr%2Fbundlemon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LironEr%2Fbundlemon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LironEr%2Fbundlemon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LironEr%2Fbundlemon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LironEr","download_url":"https://codeload.github.com/LironEr/bundlemon/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254471061,"owners_count":22076585,"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":["bundle","bundlesize","github","hacktoberfest","monitor","size","webpack"],"created_at":"2024-10-10T22:54:20.226Z","updated_at":"2025-05-16T05:04:17.565Z","avatar_url":"https://github.com/LironEr.png","language":"TypeScript","readme":"\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://github.com/LironEr/bundlemon\"\u003e\u003cimg src=\"./assets/bundlemon-optimized.svg\" alt=\"BundleMon logo\" width=\"150px\" height=\"150px\" /\u003e\u003c/a\u003e\n\u003c/div\u003e\n\n# BundleMon\n\n[![npm](https://img.shields.io/npm/v/bundlemon)](https://www.npmjs.com/package/bundlemon)\n[![node](https://img.shields.io/node/v/bundlemon)](https://github.com/LironEr/bundlemon)\n[![npm](https://img.shields.io/npm/l/bundlemon)](https://www.npmjs.com/package/bundlemon)\n[![npm](https://img.shields.io/npm/dm/bundlemon)](https://www.npmjs.com/package/bundlemon)\n\nBundleMon helps you to monitor your bundle size.\n\nYour goal is to keep your bundle size as small as possible to reduce the amount of time it takes for users to load your website/application. This is particularly important for users on low bandwidth connections.\n\nBundleMon helps you achieve that by constantly monitoring your bundle size on every commit and alerts you on changes.\n\n## Features\n\n- Set max size for files, will fail build if exceeded\n- Compare files to base branch\n- Set max increase allowed in percentage from base branch, will fail build if exceeded\n- Supports multiple CI\n- Integrates with Github, can post build status \u0026 comment with detailed information\n- History report - [example](https://app.bundlemon.dev/projects/60a928cfc1ab380009f5cc0b/reports?branch=main\u0026resolution=days)\n- [Self hosted option](./docs/self-hosted/README.md)\n\n\u003cp align=\"middle\"\u003e\n  \u003cimg src=\"./assets/history-hover-commit.png\" alt=\"History report - specific commit\" height=\"200px\" /\u003e\n  \u003cimg src=\"./assets/history.png\" alt=\"History report\" height=\"200px\" /\u003e\n\u003c/p\u003e\n\n## Guides\n\n- [Migration guide from v1 to v2](./docs/migration-v1-to-v2.md)\n- [Step by step guide to set up BundleMon with Github actions](https://github.com/LironEr/bundlemon-github-actions)\n- [Step by step guide to set up BundleMon with CodeFresh](https://github.com/LironEr/bundlemon-codefresh-example)\n\n## Setup\n\n```\nnpm install bundlemon --save-dev\n\n# or\n\nyarn add bundlemon --dev\n```\n\nAdd `bundlemon` property to your `package.json`\n\n```\n\"bundlemon\": {\n  \"baseDir\": \"./build\",\n  \"files\": [\n    {\n      \"path\": \"index.html\",\n      \"maxSize\": \"2kb\",\n      \"maxPercentIncrease\": 5\n    },\n    {\n      \"path\": \"bundle.\u003chash\u003e.js\",\n      \"maxSize\": \"10kb\"\n    },\n    {\n      \"path\": \"assets/**/*.{png,svg}\"\n    }\n  ]\n}\n```\n\nBundleMon config can be placed in other places like: `.bundlemonrc`, `.bundlemonrc.json`, `bundlemon.config.js` exporting a JS object, more forms can be found [here](https://github.com/davidtheclark/cosmiconfig)\n\n| Name                 | Description                                                                                                                                                               | Type                               | Default                      |\n| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------- | ---------------------------- |\n| baseDir              | Relative/absolute path to the directory                                                                                                                                   | `string`                           | `process.cwd()`              |\n| files                | [Files config](./docs/types.md#File)                                                                                                                                      | `FileConfig[]`                     | -                            |\n| groups               | Sum all file sizes matching the pattern, rules applies to the sum of the files [Groups config](./docs/types.md#File)                                                      | `FileConfig[]`                     | -                            |\n| defaultCompression   | Use compression before calculating file size                                                                                                                              | `\"none\"` \\| `\"gzip\"` \\| `\"brotli\"` | `\"gzip\"`                     |\n| reportOutput         | [Output options](./docs/output.md)                                                                                                                                        | `(string \\| [string, object])[]`   | []                           |\n| verbose              | Print more details                                                                                                                                                        | `boolean`                          | `false`                      |\n| subProject           | By setting sub project you can use the same project id for multiple projects. This can be useful for monorepos. Can be set/overwrite with `BUNDLEMON_SUB_PROJECT` env var | `string`                           | `undefined`                  |\n| includeCommitMessage | Include commit message when saving records                                                                                                                                | `boolean`                          | `false`                      |\n| pathLabels           | More info [here](#path-labels)                                                                                                                                            | `Record\u003cstring, string\u003e`           | `{ \"hash\": \"[a-zA-Z0-9]+\" }` |\n\n## CLI usage\n\nYou can also set some of the variables using CLI flags\n\n```\nbundlemon --config my-custom-config-path.json\n```\n\n[CLI flags docs](./docs/cli-flags.md)\n\n## Path labels\n\nWhen using hash in file names the file name can be changed every build.\n\nIn order for BundleMon to keep track of your files you can use `\u003chash\u003e` to replace the hash with a constant string.\n\nFor example:\n\n```\nindex.html\nhome.b72f15a3.chunk.js\nlogin.057c430b.chunk.js\nbundle.ea45e578.js\n```\n\nConfig:\n\n```json\n\"bundlemon\": {\n  \"baseDir\": \"./build\",\n  \"files\": [\n    {\n      \"path\": \"*.\u003chash\u003e.chunk.js\"\n    },\n    {\n      \"path\": \"*.\u003chash\u003e.js\"\n    }\n  ]\n}\n```\n\nOutput:\n\n```\n[PASS] bundle.(hash).js: 19.67KB\n[FAIL] home.(hash).chunk.js: 70.09KB \u003e 50KB\n[PASS] login.(hash).chunk.js: 3.37KB \u003c 50KB\n```\n\n\u003e [!TIP]\n\u003e You can customize the default labels and add more labels, more info [here](docs/customPathLabels.md)\n\n## BundleMon Project\n\nIn order to save history and get differences from your main branches BundleMon will need a project id.\n\n**If you are running BundleMon in GitHub actions** BundleMon will detect all necessary information automatically, Just [Install BundleMon GitHub App](https://github.com/apps/bundlemon).\n\n**If not**, you will need to create a new project and setup environment variables.\n\n- [Create new project](https://app.bundlemon.dev/create-project) and copy the project ID and API key\n- Add the ID to `BUNDLEMON_PROJECT_ID` and the API key to `BUNDLEMON_PROJECT_APIKEY` environment variables in your CI\n\n## GitHub integration\n\nBundleMon can create GitHub check run, post commit status and a detailed comment on your PR.\n\n\u003cimg src=\"./assets/check-run.png\" alt=\"GitHub check run\" height=\"300px\" /\u003e\n\u003cbr /\u003e\n\u003cimg src=\"./assets/build-status-pass.png\" alt=\"GitHub build status\" height=\"50px\" /\u003e\n\u003cbr /\u003e\n\u003cimg src=\"./assets/pr-comment.png\" alt=\"GitHub detailed comment\" height=\"300px\" /\u003e\n\n1. [Install BundleMon GitHub App](https://github.com/apps/bundlemon)\n2. Setup integration\n\n   - If BundleMon runs in GitHub actions you can go to step 2.\n   - If BundleMon not runs In GitHub actions you will need to [create GitHub access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token) without any scopes, the token owner must have write permission to the repo you would want to post outputs to.\n\n     Add the token to `BUNDLEMON_GITHUB_TOKEN` environment variable in your CI.\n\n     \u003e The token is not saved in BundleMon service, ONLY used to verify the username that created the token.\n\n3. Add `github` to `reportOutput`\n\n   ```json\n   \"reportOutput\": [\"github\"]\n\n   // override default options\n\n   \"reportOutput\": [\n     [\n       \"github\",\n       {\n         \"checkRun\": false,\n         \"commitStatus\": true,\n         \"prComment\": true\n       }\n     ]\n   ]\n\n   // each option support conditional values\n\n   \"reportOutput\": [\n     [\n       \"github\",\n       {\n         \"checkRun\": false, // can also be \"off\"\n         \"commitStatus\": true, // can also be \"always\"\n         \"prComment\": \"on-failure\"\n       }\n     ]\n   ]\n   ```\n\n   Each option support one of: `true | false | \"always\" | \"on-failure\" | \"pr-only\" | \"off\"`\n\n   `\"on-failure\"` option means that **only** when BundleMon limit exceeded then it will post the output (check run / commit status / PR comment) to GitHub\n\n### GitHub action example \u0026 forks support\n\nBundleMon supports running on PRs originating from forks.\n\n[Step by step guide to set up BundleMon with Github actions](https://github.com/LironEr/bundlemon-github-actions)\n\n```yaml\nname: Build\n\non:\n  push:\n    branches: [main]\n  pull_request:\n    types: [synchronize, opened, reopened]\n\njobs:\n  build:\n    runs-on: ubuntu-22.04\n    steps:\n      - uses: actions/checkout@v4\n      - name: Setup Node\n        uses: actions/setup-node@v4\n        with:\n          node-version: '20'\n\n      - name: Install dependencies\n        run: yarn\n\n      - name: Build\n        run: yarn build\n\n      - name: BundleMon\n        uses: lironer/bundlemon-action@v1\n```\n\n## Set additional environment variables\n\nIn order to get BundleMon to work you'll need to set these environment variables:\n\n\u003e If you are using one of the supported CIs (GitHub Actions, Travis and Codefresh) you dont need to set anything. CircleCI is also supported, but you need to manually set `CI_TARGET_BRANCH`.\n\n- `CI=true`\n- `CI_REPO_OWNER` - github.com/LironEr/bundlemon `LironEr`\n- `CI_REPO_NAME` - github.com/LironEr/bundlemon `bundlemon`\n- `CI_BRANCH` - source branch name\n- `CI_COMMIT_SHA` - commit SHA\n- `CI_TARGET_BRANCH` - target branch name, only set if BundleMon runs on a pull request\n- `CI_PR_NUMBER` - PR number, only set if BundleMon runs on a pull request\n- `CI_COMMIT_MESSAGE` - Optional, set it if `includeCommitMessage` option is `true`\n\n## BundleMon free hosted service\n\nBy default BundleMon is running on a free hosted server, you can also run BundleMon [on your server](./docs/self-hosted/README.md).\n\nLimitations of the free hosted service:\n\n- Records created by a PR will be deleted after 30 days.\n- Records in branches without activity (new commits) will be deleted after 180 days.\n- After 90 days only the latest record per day will be kept.\n\nMore limitations may be added in the future as more and more projects use the free hosted service.\n\n**If you want to support this project and help with server costs please consider [donating](https://github.com/sponsors/LironEr) ❤**\n\n## Contributing\n\nRead the [contributing guide](./CONTRIBUTING.md) to learn how to run this project locally and contribute.\n","funding_links":["https://github.com/sponsors/LironEr","https://issuehunt.io/r/lironer","https://www.paypal.com/donate?hosted_button_id=YZL6KM2UGB5ML"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flironer%2Fbundlemon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flironer%2Fbundlemon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flironer%2Fbundlemon/lists"}