{"id":18886321,"url":"https://github.com/fengzilong/duplicate-dependencies-webpack-plugin","last_synced_at":"2025-04-14T21:31:04.941Z","repository":{"id":42941824,"uuid":"233870958","full_name":"fengzilong/duplicate-dependencies-webpack-plugin","owner":"fengzilong","description":"A webpack plugin to check all duplicated dependencies in your bundle","archived":false,"fork":false,"pushed_at":"2023-03-04T05:43:35.000Z","size":923,"stargazers_count":5,"open_issues_count":11,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-09-19T13:50:04.829Z","etag":null,"topics":["analyzer","bundle","duplicate","webpack","webpack-plugin"],"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/fengzilong.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":"2020-01-14T15:21:19.000Z","updated_at":"2023-03-08T04:10:51.000Z","dependencies_parsed_at":"2024-06-18T21:31:25.311Z","dependency_job_id":"39cc4a0f-002c-4883-bc14-8cd5a4c793e6","html_url":"https://github.com/fengzilong/duplicate-dependencies-webpack-plugin","commit_stats":{"total_commits":31,"total_committers":2,"mean_commits":15.5,"dds":"0.19354838709677424","last_synced_commit":"e5a0f76230cd3c6b4981444c27c8fd15e7f15ae2"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fengzilong%2Fduplicate-dependencies-webpack-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fengzilong%2Fduplicate-dependencies-webpack-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fengzilong%2Fduplicate-dependencies-webpack-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fengzilong%2Fduplicate-dependencies-webpack-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fengzilong","download_url":"https://codeload.github.com/fengzilong/duplicate-dependencies-webpack-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223647043,"owners_count":17179202,"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","bundle","duplicate","webpack","webpack-plugin"],"created_at":"2024-11-08T07:26:32.765Z","updated_at":"2024-11-08T07:26:33.414Z","avatar_url":"https://github.com/fengzilong.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# duplicate-dependencies-webpack-plugin\n\n![npm version](https://img.shields.io/npm/v/duplicate-dependencies-webpack-plugin)\n![npm downloads](https://img.shields.io/npm/dm/duplicate-dependencies-webpack-plugin)\n![actions status](https://github.com/fengzilong/duplicate-dependencies-webpack-plugin/workflows/Node%20CI/badge.svg)\n\nA webpack plugin to find all duplicated dependencies in your bundle\n\n\u003cimg src=\"media/screenshot.jpg\" alt=\"screenshot\" width=\"500px\"\u003e\n\n## Installation\n\nFor yarn users\n\n```bash\nyarn add duplicate-dependencies-webpack-plugin --dev\n```\n\nFor npm users\n\n```bash\nnpm i duplicate-dependencies-webpack-plugin -D\n```\n\n## Basic Usage\n\n`webpack.config.js`\n\n```js\nconst { DuplicateReporterPlugin } = require( 'duplicate-dependencies-webpack-plugin' )\n\nmodule.exports = {\n  plugins: {\n    new DuplicateReporterPlugin()\n  }\n}\n```\n\n## Advanced Usage\n\nThis plugin is designed to be more flexible\n\nSo you may want to use it together with a reporter plugin\n\nInternally this plugin expose a hook called `result`\n\n`webpack.config.js`\n\n```js\nconst DuplicatePlugin = require( 'duplicate-dependencies-webpack-plugin' )\n\nconst ID = 'duplicates-reporter'\nclass DuplicatesReporterPlugin {\n  apply( compiler ) {\n    compiler.hooks.compilation.tap( ID, compilation =\u003e {\n      DuplicatePlugin.getHooks( compilation ).result\n        .tap( ID, duplicates =\u003e {\n          // here you get the `duplicates` data\n          // do whatever you want with this\n          useCustomPrettyReporter( duplicates )\n        } )\n    } )\n  }\n}\n\nmodule.exports = {\n  plugins: {\n    new DuplicatePlugin(),\n    new DuplicatesReporterPlugin()\n  }\n}\n```\n\nduplicates looks like:\n\n```js\n{\n  'package_name': [\n    {\n      name: 'package_name',\n      version: '4.2.2',\n      root: 'absolute_path_to_package_root',\n      issuer: 'absolute_path_to_issuer', // the file issue the request\n      files: [Array], // files in this package which are included in your bundle\n      bytes: 4000 // bytes contributed by this packages\n    },\n    // ...more versions\n  ]\n}\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffengzilong%2Fduplicate-dependencies-webpack-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffengzilong%2Fduplicate-dependencies-webpack-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffengzilong%2Fduplicate-dependencies-webpack-plugin/lists"}