{"id":13813226,"url":"https://github.com/django-webpack/webpack-bundle-tracker","last_synced_at":"2025-04-14T08:53:37.166Z","repository":{"id":32160042,"uuid":"35733197","full_name":"django-webpack/webpack-bundle-tracker","owner":"django-webpack","description":"Spits out some stats about webpack compilation process to a file","archived":false,"fork":false,"pushed_at":"2024-08-30T17:52:23.000Z","size":690,"stargazers_count":268,"open_issues_count":4,"forks_count":106,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-04-09T09:49:28.118Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"codrops/AnimatedResponsiveImageGrid","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/django-webpack.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"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}},"created_at":"2015-05-16T17:28:56.000Z","updated_at":"2025-04-04T13:37:06.000Z","dependencies_parsed_at":"2024-01-08T16:03:59.279Z","dependency_job_id":"968df4d4-ae35-4c0a-bcc7-16fb96f7b3d1","html_url":"https://github.com/django-webpack/webpack-bundle-tracker","commit_stats":{"total_commits":93,"total_committers":29,"mean_commits":3.206896551724138,"dds":0.6989247311827957,"last_synced_commit":"75b9a2e7feed7f68c00ffb71c6449dc615cfa3ea"},"previous_names":["owais/webpack-bundle-tracker"],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/django-webpack%2Fwebpack-bundle-tracker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/django-webpack%2Fwebpack-bundle-tracker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/django-webpack%2Fwebpack-bundle-tracker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/django-webpack%2Fwebpack-bundle-tracker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/django-webpack","download_url":"https://codeload.github.com/django-webpack/webpack-bundle-tracker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248654096,"owners_count":21140236,"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-08-04T04:01:08.381Z","updated_at":"2025-04-14T08:53:37.144Z","avatar_url":"https://github.com/django-webpack.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# Webpack Bundle Tracker\n\n[![master build status](https://github.com/django-webpack/webpack-bundle-tracker/actions/workflows/config.yml/badge.svg)](https://github.com/django-webpack/webpack-bundle-tracker/actions/workflows/config.yml)\n\nSpits out some stats about webpack compilation process to a file.\n\n## Install\n\n```bash\nnpm install --save-dev webpack-bundle-tracker\n```\n\n## Compatibility\n\nThis project is compatible with NodeJS versions 16 and up.\n\n:warning: Starting on version 17, NodeJS uses OpenSSL v3 which has compatibility issues with Webpack@4. This isn't an issue for Webpack@5, however\nif you're using Node \u003e= 17 and Webpack@4, to properly use this package you must ensure to set the `NODE_OPTIONS=--openssl-legacy-provider` environment\nvariable. You can read more about this on https://github.com/webpack/webpack/issues/14532.\n\n## Migrating from version 1.x.y to 2.x.y\n\nStarting on version 2.0.0, when creating a new instance of `BundleTracker`, the usage of the `path` parameter has been fixed and it's now being used to generate the output path for the stats file, together with the `filename` parameter. On version 2.0.0, if the `path` parameter is ommited from the constuctor call, it will attempt to place the stats file at the `output.path` directory (if also ommited, will use `'.'` as a fallback). Also, version 2.0.0 doesn't allow sub-directories to be included on the `filename`, only allowing to include them on the `path` param. To avoid those issues, when migrating, double-check if the file placement is as expected. The usage of these parameters is documented [here](#usage) and [here](#options).\n\n## Usage\n\n```javascript\nvar path = require('path');\nvar BundleTracker = require('webpack-bundle-tracker');\nmodule.exports = {\n  context: __dirname,\n  entry: {\n    app: ['./app'],\n  },\n\n  output: {\n    path: path.resolve('./assets/bundles/'),\n    filename: '[name]-[hash].js',\n    publicPath: 'http://localhost:3000/assets/bundles/',\n  },\n\n  plugins: [\n    new BundleTracker({\n      path: path.join(__dirname, 'assets'),\n      filename: 'webpack-stats.json',\n    }),\n  ],\n};\n```\n\nThe `webpack-stats.json` file will look like,\n\n```json\n{\n  \"status\": \"done\",\n  \"chunks\": {\n    \"app\": [\"app-0828904584990b611fb8.js\"]\n  },\n  \"assets\": {\n    \"app-0828904584990b611fb8.js\": {\n      \"name\": \"app-0828904584990b611fb8.js\",\n      \"publicPath\": \"http://localhost:3000/assets/bundles/app-0828904584990b611fb8.js\",\n      \"path\": \"/home/user/project-root/assets/bundles/app-0828904584990b611fb8.js\"\n    }\n  }\n}\n```\n\nIn case webpack is still compiling, it'll look like,\n\n```json\n{\n  \"status\": \"compile\"\n}\n```\n\nAnd errors will look like,\n\n```json\n{\n  \"status\": \"error\",\n  \"file\": \"/path/to/file/that/caused/the/error\",\n  \"error\": \"ErrorName\",\n  \"message\": \"ErrorMessage\"\n}\n```\n\n`ErrorMessage` shows the line and column that caused the error.\n\nAnd in case `logTime` option is set to `true`, the output will look like,\n\n```json\n{\n  \"status\": \"done\",\n  \"chunks\": {\n    \"app\": [\"app-0828904584990b611fb8.js\"]\n  },\n  \"assets\": {\n    \"app-0828904584990b611fb8.js\": {\n      \"name\": \"app-0828904584990b611fb8.js\",\n      \"publicPath\": \"http://localhost:3000/assets/bundles/app-0828904584990b611fb8.js\",\n      \"path\": \"/home/user/project-root/assets/bundles/app-0828904584990b611fb8.js\"\n    }\n  },\n  \"startTime\": 1440535322138,\n  \"endTime\": 1440535326804\n}\n```\n\nAnd in case `relativePath` option is set to `true`, the output will look like,\n\n```json\n{\n  \"status\": \"done\",\n  \"chunks\": {\n    \"app\": [\"app-0828904584990b611fb8.js\"]\n  },\n  \"assets\": {\n    \"app-0828904584990b611fb8.js\": {\n      \"name\": \"app-0828904584990b611fb8.js\",\n      \"publicPath\": \"http://localhost:3000/assets/bundles/app-0828904584990b611fb8.js\",\n      \"path\": \"app-0828904584990b611fb8.js\"\n    }\n  }\n}\n```\n\nAnd in case `integrity` option is set to `true`, the output will look like,\n\n```json\n{\n  \"status\": \"done\",\n  \"chunks\": {\n    \"app\": [\"app-0828904584990b611fb8.js\"]\n  },\n  \"assets\": {\n    \"app-0828904584990b611fb8.js\": {\n      \"name\": \"app-0828904584990b611fb8.js\",\n      \"publicPath\": \"http://localhost:3000/assets/bundles/app-0828904584990b611fb8.js\",\n      \"path\": \"app-0828904584990b611fb8.js\",\n      \"integrity\": \"sha256-yAIefNWsF0IfxalAlLNngdY0t3J1h4IzZLzcJEn/FTM= sha384-QmiRCOdQx6MVC721liFMbJjud6Kr5ryT1vhHI5htzftpzoI1P3IlBqbpg5AHjbBv sha512-kbLjakids0Z2vvrOrtV7s2FUvKcgM3bg0WQwuyGvJPE+zVqOL4t0UvWkeUzz5z2ZrDm0ST/dQjPBJaq7rDB/2Q==\"\n    }\n  }\n}\n```\n\nAnd in case of usage of compression plugin for webpack, the output will look like,\n\n```json\n{\n  \"status\": \"done\",\n  \"chunks\": {\n    \"app\": [\"app-0828904584990b611fb8.js\"]\n  },\n  \"assets\": {\n    \"app-0828904584990b611fb8.js\": {\n      \"name\": \"app-0828904584990b611fb8.js\",\n      \"publicPath\": \"http://localhost:3000/assets/bundles/app-0828904584990b611fb8.js\",\n      \"path\": \"/home/user/project-root/assets/bundles/app-0828904584990b611fb8.js\"\n    },\n    \"app-0828904584990b611fb8.js.br\": {\n      \"name\": \"app-0828904584990b611fb8.js.br\",\n      \"publicPath\": \"http://localhost:3000/assets/bundles/app-0828904584990b611fb8.js.br\",\n      \"path\": \"/home/user/project-root/assets/bundles/app-0828904584990b611fb8.js.br\"\n    },\n    \"app-0828904584990b611fb8.js.gz\": {\n      \"name\": \"app-0828904584990b611fb8.js.gz\",\n      \"publicPath\": \"http://localhost:3000/assets/bundles/app-0828904584990b611fb8.js.gz\",\n      \"path\": \"/home/user/project-root/assets/bundles/app-0828904584990b611fb8.js.gz\"\n    }\n  }\n}\n```\n\nBy default, the output JSON will not be indented. To increase readability, you can use the `indent`\noption to make the output legible. By default it is off. The value that is set here will be directly\npassed to the `space` parameter in `JSON.stringify`. More information can be found [here](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify)\n\n## Options\n\n| Name              | Type        | Default                          | Description                                                                                                                     |\n| ----------------- | ----------- | -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |\n| `path`            | `{String}`  | `'.'`                            | Output directory of bundle tracker JSON file. Will attempt to use `output.path` before falling back to the default value.       |\n| `filename`        | `{String}`  | `'webpack-stats.json'`           | Name of the bundle tracker JSON file.                                                                                           |\n| `publicPath`      | `{String}`  | (ignored)                        | Override `output.publicPath` from Webpack config.                                                                               |\n| `relativePath`    | `{Boolean}` | `false`                          | Show relative path instead of absolute path for bundles in JSON Tracker file. Path are relative from path of JSON Tracker file. |\n| `logTime`         | `{Boolean}` | `false`                          | Output `startTime` and `endTime` properties in bundle tracker JSON file.                                                        |\n| `integrity`       | `{Boolean}` | `false`                          | Output `integrity` property for each asset entry.                                                                               |\n| `integrityHashes` | `{Array}`   | `['sha256', 'sha384', 'sha512']` | Cryptographic hash functions used to compute integrity for each asset.                                                          |\n| `indent`          | `{Integer}` | `undefined`                      | Format resulting JSON file for better readability.                                                                              |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdjango-webpack%2Fwebpack-bundle-tracker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdjango-webpack%2Fwebpack-bundle-tracker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdjango-webpack%2Fwebpack-bundle-tracker/lists"}