{"id":16347704,"url":"https://github.com/privatenumber/webpack-dependency-size","last_synced_at":"2025-03-03T16:30:54.865Z","repository":{"id":54707149,"uuid":"262678760","full_name":"privatenumber/webpack-dependency-size","owner":"privatenumber","description":"👩‍🔬 Webpack plugin to get an overview of bundled dependencies and their size","archived":false,"fork":false,"pushed_at":"2021-02-02T22:54:57.000Z","size":56,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"develop","last_synced_at":"2025-02-23T23:19:03.537Z","etag":null,"topics":["analyzer","dependency","optimization-tools","size","webpack"],"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/privatenumber.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}},"created_at":"2020-05-09T23:43:32.000Z","updated_at":"2022-05-12T13:47:02.000Z","dependencies_parsed_at":"2022-08-14T00:40:19.219Z","dependency_job_id":null,"html_url":"https://github.com/privatenumber/webpack-dependency-size","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/privatenumber%2Fwebpack-dependency-size","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/privatenumber%2Fwebpack-dependency-size/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/privatenumber%2Fwebpack-dependency-size/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/privatenumber%2Fwebpack-dependency-size/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/privatenumber","download_url":"https://codeload.github.com/privatenumber/webpack-dependency-size/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241698984,"owners_count":20005300,"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":["analyzer","dependency","optimization-tools","size","webpack"],"created_at":"2024-10-11T00:45:01.106Z","updated_at":"2025-03-03T16:30:54.518Z","avatar_url":"https://github.com/privatenumber.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1\u003e\n\t👩‍🔬 Webpack Dependency Size Plugin\n\t\u003ca href=\"https://npm.im/webpack-dependency-size\"\u003e\u003cimg src=\"https://badgen.net/npm/v/webpack-dependency-size\"\u003e\u003c/a\u003e\n\t\u003ca href=\"https://npm.im/webpack-dependency-size\"\u003e\u003cimg src=\"https://badgen.net/npm/dm/webpack-dependency-size\"\u003e\u003c/a\u003e\n\t\u003ca href=\"https://packagephobia.now.sh/result?p=webpack-dependency-size\"\u003e\u003cimg src=\"https://packagephobia.now.sh/badge?p=webpack-dependency-size\"\u003e\u003c/a\u003e\n\u003c/h1\u003e\n\n[Webpack](https://webpack.js.org) plugin to get an overview of bundled dependencies and their size.\n\n## :raising_hand: Why?\n- 📦 **Only Dependencies** Get insight into the blackbox!\n- 🔥 **Fast** Only analyzes the bare minium!\n- 👀 **JSON Output** Formatted, sorted, and portable!\n- 🙈 **No distractions** Ignore application code!\n\n## :rocket: Install\n```sh\nnpm i -D webpack-dependency-size\n```\n\n## 👩‍🏫 Basic Usage\nIn your Webpack config:\n```js\n// 1. Import plugin\nconst DependencySize = require('webpack-dependency-size');\n\nmodule.exports = {\n\t...,\n\n\tplugins: [\n\t\t// 2. Add to plugins array\n\t\tnew DependencySize()\n\t]\n};\n```\n\n### Options\nPass in an options object to configure:\n```js\nnew DependencySize({\n\t// Options\n\tgzip: true\n})\n```\n- `outputPath` (`dependency-size.json`) JSON output path relative to Webpack output directory (`output.path`)\n- `gzip` (`false`) Calculate gzipped size\n- `indent` (2 spaces) JSON output indentation\n\n## 📋 Output\n\n### Schema\n```js\ntype File = {\n    filepath: string; // bundled-in file\n    size: string; // human-readable size\n    reasons: string[]; // request sources\n};\n\ntype Report = {\n    dependencyPath: string; // bundled-in package (sorted by `size`)\n    size: string; // human-readable net import size from package\n    files: File[]; // specific files imported from the package (sorted by `size`)\n}[];\n```\n\n### Example\n\n\u003e Tip: If the output is too large, I recommend using [fx](https://github.com/antonmedv/fx) to navigate the JSON\n\n```json5\n[\n  {\n    \"dependencyPath\": \"./node_modules/axios\",\n    \"size\": \"40.15 KB\",\n    \"files\": [\n      {\n        \"filepath\": \"./node_modules/axios/lib/utils.js\",\n        \"size\": \"8.61 KB\",\n        \"reasons\": [\n          \"./node_modules/axios/lib/adapters/xhr.js\",\n          ...\n        ]\n      },\n      ...\n    ]\n  },\n  {\n    \"dependencyPath\": \"./node_modules/lodash\",\n    \"size\": \"25.37 KB\",\n    \"files\": [\n      {\n        \"filepath\": \"./node_modules/lodash/_deburrLetter.js\",\n        \"size\": \"3.33 KB\",\n        \"reasons\": [\n          \"./node_modules/lodash/deburr.js\"\n        ]\n      },\n      ...\n    ]\n  },\n  ...\n]\n```\n\n## 👨‍👩‍👦‍👦 Related\n\n- [webpack-distsize](https://github.com/privatenumber/webpack-distsize) - Track Webpack output size via version control\n- [webpack-analyze-duplication-plugin](https://github.com/privatenumber/webpack-analyze-duplication-plugin) - Webpack plugin to detect duplicated modules\n\n\n## 💼 License\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprivatenumber%2Fwebpack-dependency-size","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprivatenumber%2Fwebpack-dependency-size","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprivatenumber%2Fwebpack-dependency-size/lists"}