{"id":13550665,"url":"https://github.com/d4rkr00t/whybundled","last_synced_at":"2025-05-16T07:04:30.609Z","repository":{"id":29769578,"uuid":"122733470","full_name":"d4rkr00t/whybundled","owner":"d4rkr00t","description":"Answers the question – Why the hell is this module in a bundle?","archived":false,"fork":false,"pushed_at":"2023-01-07T03:57:17.000Z","size":2686,"stargazers_count":534,"open_issues_count":5,"forks_count":9,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-05-03T01:21:16.880Z","etag":null,"topics":["bundle","bundle-size","stats","webpack"],"latest_commit_sha":null,"homepage":"","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/d4rkr00t.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-24T11:12:27.000Z","updated_at":"2025-04-11T04:53:12.000Z","dependencies_parsed_at":"2023-01-14T15:45:20.861Z","dependency_job_id":null,"html_url":"https://github.com/d4rkr00t/whybundled","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d4rkr00t%2Fwhybundled","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d4rkr00t%2Fwhybundled/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d4rkr00t%2Fwhybundled/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d4rkr00t%2Fwhybundled/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/d4rkr00t","download_url":"https://codeload.github.com/d4rkr00t/whybundled/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254485054,"owners_count":22078767,"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","bundle-size","stats","webpack"],"created_at":"2024-08-01T12:01:35.944Z","updated_at":"2025-05-16T07:04:25.598Z","avatar_url":"https://github.com/d4rkr00t.png","language":"TypeScript","funding_links":[],"categories":["TypeScript","JavaScript","Tools","📦 Legacy \u0026 Inactive Projects"],"sub_categories":["Bundle Analyzers"],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cbr/\u003e\n  \u003cbr/\u003e\n  \u003cimg src=\"./assets/logo.png\" alt=\"whybundled\" width=\"600\" align=\"center\"\u003e\n  \u003cbr/\u003e\n  \u003cbr/\u003e\n  \u003cbr/\u003e\n  \u003cbr/\u003e\n  \u003cbr/\u003e\n\u003c/div\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://npmjs.org/package/whybundled\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/v/whybundled.svg\" alt=\"NPM Version\"\u003e\n  \u003c/a\u003e\n\n  \u003ca href=\"http://opensource.org/licenses/MIT\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/l/whybundled.svg\" alt=\"License\"\u003e\n  \u003c/a\u003e\n\n  \u003ca href=\"https://github.com/d4rkr00t/whybundled/issues\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/issues/d4rkr00t/whybundled.svg\" alt=\"Github Issues\"\u003e\n  \u003c/a\u003e\n\n  \u003ca href='https://coveralls.io/github/d4rkr00t/whybundled'\u003e\n    \u003cimg src='https://coveralls.io/repos/github/d4rkr00t/whybundled/badge.svg' alt='Coverage Status' /\u003e\n  \u003c/a\u003e\n\n  \u003ca href=\"http://commitizen.github.io/cz-cli/\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/commitizen-friendly-brightgreen.svg\" alt=\"Commitizen Friendly\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\u003cbr/\u003e\n\u003cbr/\u003e\n\nEver wondered why any particular module ended up in a bundle? WhyBundled is here to answer exactly this question.\n\nIt's meant to be used alongside [stats report from webpack](https://webpack.js.org/api/stats/).\n\n## Quick Start\n\n```sh\nnpm i -g whybundled\n\nwhybundled stats.json ← stats file generated by wepback\n```\n\n![whybundled default report](/assets/screenshot.png)\n\n## Usage\n\n```sh\nUSAGE\n  whybundled stats.json [pattern]\n\nCOMMANDS\n  by     Shows all modules that were brought into the bundle by a particular module.\n\nOPTIONS\n  --limit              Limits output of reasons and files [number] [default: 20]\n  --filesOnly          Only include files [boolean]\n  --modulesOnly        Only include modules [boolean]\n  --directoryOnly      Only include direct dependencies [boolean]\n  --transitiveOnly     Only include transitive dependencies [boolean]\n  --duplicatesOnly     Only include modules that have duplicates in a resulting bundle [boolean]\n  --ignore             Comma separated list of glob patterns to exclude modules from final output [string]\n  --sortBy             Sort modules, available fields: size, imported. E.g. size:asc or size:desc. [string]\n  --help               Output usage information\n  --version            Output the version number\n\nEXAMPLES\n  whybundled stats.json --ignore babel-runtime,tslib\n  whybundled stats.json --modulesOnly\n  whybundled by stats.json styled-components\n```\n\n## Features\n\n### Stats Analyses\n\n- Outputs list of all modules/files included in the bundle in from most imported to least imported order.\n- Builds a chain of dependencies for transitive dependencies.\n- Shows all files that were included for particular module.\n- Shows all reasons why particular module was included.\n\n```sh\nMODULE  isobject\n├─ imported: 1 time     ← number of times module imported\n├─ type: [transitive]   ← type of a dependency can be either direct or transitive\n│  └─ isobject -\u003e is-plain-object -\u003e styled-components    ← for transitive dependencies whybundled outputs a chain of dependencies up to the closest direct\n│\n├─ locations:  ← where module is located in a project\n│  └─ ../node_modules/isobject/\n│\n├─ files:      ← list of files that were included for this module\n│  └─ ../node_modules/isobject/index.js\n│\n└─ reasons:    ← list of reasons why module was included in a bundle\n   └─ is-plain-object\n      └─ ../node_modules/is-plain-object/index.js  10:15-34  [cjs require]\n```\n\n### Duplicates Badge\n\nIf module has been bundled several times from different locations `whybundled` adds `[multiple]` badge next to the locations field:\n\n![whybundled duplicates](/assets/multiple.png)\n\n### Brought by\n\nUsing `by` command `whybundled` shows all modules that were brought into the bundle by a particular module:\n\n```sh\nUSAGE\n  whybundled by stats.json [pattern]\n\nOPTIONS\n  --limit      Limits output of reasons and files [number=20]\n  --only       Limits output to only include modules that were included by specified module exclusively [boolean]\n  --ignore     Comma separated list of glob patterns to exclude modules from final output [string]\n\nEXAMPLES\n  whybundled by stats.json styled-components\n  whybundled by stats.json styled-components --ignore babel-runtime,tslib\n  whybundled by stats.json styled-components --only\n```\n\n![whybundled brought by](/assets/by.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fd4rkr00t%2Fwhybundled","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fd4rkr00t%2Fwhybundled","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fd4rkr00t%2Fwhybundled/lists"}