{"id":26246236,"url":"https://github.com/zillow/webpack-stats-duplicates","last_synced_at":"2025-04-23T20:27:08.059Z","repository":{"id":48467092,"uuid":"77480653","full_name":"zillow/webpack-stats-duplicates","owner":"zillow","description":"Search your webpack bundle stats.json for duplicate modules","archived":false,"fork":false,"pushed_at":"2021-07-25T11:40:32.000Z","size":69,"stargazers_count":31,"open_issues_count":1,"forks_count":3,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-04-14T05:18:03.358Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zillow.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-12-27T20:24:22.000Z","updated_at":"2024-02-08T15:10:50.000Z","dependencies_parsed_at":"2022-08-20T00:30:58.210Z","dependency_job_id":null,"html_url":"https://github.com/zillow/webpack-stats-duplicates","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zillow%2Fwebpack-stats-duplicates","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zillow%2Fwebpack-stats-duplicates/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zillow%2Fwebpack-stats-duplicates/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zillow%2Fwebpack-stats-duplicates/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zillow","download_url":"https://codeload.github.com/zillow/webpack-stats-duplicates/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250508160,"owners_count":21442169,"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":"2025-03-13T13:17:41.347Z","updated_at":"2025-04-23T20:27:08.042Z","avatar_url":"https://github.com/zillow.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# webpack-stats-duplicates\n\nA utility for examining webpack stats.json files and looking for duplicate module imports. Inspired by [Webpack Visualizer](https://chrisbateman.github.io/webpack-visualizer/), an excellent tool for visualizing your webpack bundle. There is also a [gulp plugin](https://github.com/zillow/gulp-webpack-stats-duplicates) if you are into that.\n\n## CLI\n\n### Installation\n\n```\n$ npm install -g webpack-stats-duplicates\n```\n\n### Usage\n\n```\n$ webpack-stats-duplicates stats.json\n```\n![Usage example](examples/example.png?raw=true)\n\nUse the `--help` flag to see all command line options.\n\n### Config file\n\nYou can create a configuration file with options such as `whitelist` to be used when running.\nThe utility will look for a `.wsdrc` file in the current working directory,\nor you can specify the location of the file with `--config` on the command line.\nSee [`findDuplicates`](#findduplicatesjson-options--array) for all available configuration options.\n\n## API\n\n### Installation\n\n```\n$ npm install --save webpack-stats-duplicates\n```\n\n### `findDuplicates(json[, options]) =\u003e Array`\n\n#### Arguments\n\n1. `json` (`Object`): The stats json object from webpack\n2. `options` (`Object` [optional])\n3. `options.whitelist` (`Array` [optional]): An array of duplicate paths to ignore\n\n#### Returns\n\n`Array`: An array of found duplicates.\n\n#### Example\n\n```\nimport { findDuplicates } from 'webpack-stats-duplicates';\n\nconst duplicates = findDuplicates(json, {\n  whitelist: [ '/node_modules/flux/node_modules/fbjs' ]\n});\n```\n\n### `printDuplicates(duplicates)`\n\n#### Arguments\n\n1. `duplicates` (`Array`): The duplicates array from [`findDuplicates`](#findduplicatesjson-options--array)\n\n### `loadConfig([filename], callback)`\n\n#### Arguments\n\n1. `filename` (`String` [optional]): The filename to load config from, if omitted, will attempt to load the default `.wsdrc` file\n2. `callback` (`Function`): Callback function that takes two arguments, `error` and `config`\n\n#### Example\n\n```\nimport { loadConfig } from 'webpack-stats-duplicates';\n\nlet findDuplicatesOpts = {};\nloadConfig('./path/to/my/config.json', (error, config) =\u003e {\n  if (error) {\n    console.log(error);\n    return;\n  }\n  findDuplicatesOpts = config;\n});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzillow%2Fwebpack-stats-duplicates","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzillow%2Fwebpack-stats-duplicates","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzillow%2Fwebpack-stats-duplicates/lists"}