{"id":13606665,"url":"https://github.com/tjx666/unplugin-detect-duplicated-deps","last_synced_at":"2025-08-12T18:43:38.393Z","repository":{"id":170366859,"uuid":"646422978","full_name":"tjx666/unplugin-detect-duplicated-deps","owner":"tjx666","description":"Detect duplicate packaged dependencies","archived":false,"fork":false,"pushed_at":"2024-03-30T14:11:22.000Z","size":1421,"stargazers_count":79,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-09T20:09:45.941Z","etag":null,"topics":["rollup","unplugin","vite"],"latest_commit_sha":null,"homepage":"https://unplugin-detect-duplicated-deps.vercel.app","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/tjx666.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2023-05-28T11:00:53.000Z","updated_at":"2025-02-03T22:02:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"956cc8b7-2f19-4343-b1bd-28b947b1996e","html_url":"https://github.com/tjx666/unplugin-detect-duplicated-deps","commit_stats":null,"previous_names":["tjx666/unplugin-detect-duplicated-deps"],"tags_count":20,"template":false,"template_full_name":"tjx666/unplugin-starter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tjx666%2Funplugin-detect-duplicated-deps","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tjx666%2Funplugin-detect-duplicated-deps/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tjx666%2Funplugin-detect-duplicated-deps/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tjx666%2Funplugin-detect-duplicated-deps/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tjx666","download_url":"https://codeload.github.com/tjx666/unplugin-detect-duplicated-deps/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248103871,"owners_count":21048245,"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":["rollup","unplugin","vite"],"created_at":"2024-08-01T19:01:11.301Z","updated_at":"2025-04-09T20:09:51.001Z","avatar_url":"https://github.com/tjx666.png","language":"TypeScript","funding_links":[],"categories":["Plugins"],"sub_categories":["Framework-agnostic Plugins"],"readme":"# unplugin-detect-duplicated-deps\n\n[![npm](https://img.shields.io/npm/v/unplugin-detect-duplicated-deps.svg)](https://npmjs.com/package/unplugin-detect-duplicated-deps) [![downloads](https://img.shields.io/npm/dw/unplugin-detect-duplicated-deps)](https://npmjs.com/package/unplugin-detect-duplicated-deps) [![Unit Test](https://github.com/tjx666/unplugin-detect-duplicated-deps/actions/workflows/unit-test.yml/badge.svg)](https://github.com/tjx666/unplugin-detect-duplicated-deps/actions/workflows/unit-test.yml)\n\nDetect duplicate packaged dependencies\n\n![effect](./docs/images/effect.png)\n\n## Installation\n\n```bash\nnpm i -D unplugin-detect-duplicated-deps\n```\n\n## Usage\n\nYou can use the jsdoc to check option description and default value.\n\n\u003cdetails\u003e\n\u003csummary\u003eVite\u003c/summary\u003e\u003cbr\u003e\n\n```ts\n// vite.config.ts\nimport UnpluginDetectDuplicatedDeps from 'unplugin-detect-duplicated-deps/vite';\n\nexport default defineConfig({\n  plugins: [UnpluginDetectDuplicatedDeps()],\n});\n```\n\n\u003cbr\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eRollup\u003c/summary\u003e\u003cbr\u003e\n\n```ts\n// rollup.config.js\nimport UnpluginDetectDuplicatedDeps from 'unplugin-detect-duplicated-deps/rollup';\n\nexport default {\n  plugins: [UnpluginDetectDuplicatedDeps()],\n};\n```\n\n\u003cbr\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eWebpack\u003c/summary\u003e\u003cbr\u003e\n\n```ts\n// webpack.config.mjs\nimport UnpluginDetectDuplicatedDeps from 'unplugin-detect-duplicated-deps/webpack';\n\nconst config = {\n  plugins: [UnpluginDetectDuplicatedDeps()],\n};\n```\n\n\u003cbr\u003e\n\u003c/details\u003e\n\n## Use as build checker\n\n```ts\nexport default defineConfig({\n  plugins: [\n    UnpluginDetectDuplicatedDeps({\n      // will exit build process if duplicated deps found\n      throwErrorWhenDuplicated: true,\n      // ignore specific duplicated deps\n      ignore: {\n        axios: ['0.27.2'],\n        vue: ['*'],\n      },\n    }),\n  ],\n});\n```\n\n## Use in commonjs environment\n\nBecause [vite6 plan to deprecate commonjs node api](https://vitejs.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated), this plugin deprecate the commonjs support from 1.x. If you want use this plugin in commonjs environment, check [0.x](https://github.com/tjx666/unplugin-detect-duplicated-deps/tree/0.x)\n\n## Thanks\n\n- [duplicate-package-checker-webpack-plugin](https://github.com/darrenscerri/duplicate-package-checker-webpack-plugin)\n- [unplugin](https://github.com/unjs/unplugin)\n- [unplugin-starter](https://github.com/sxzz/unplugin-starter)\n- [bundlephobia](https://bundlephobia.com/) provide the api to get package size\n- [vercel](https://vercel.com/) host documentation\n\n## Recommend Readings\n\n- [Rsdoctor | Duplicate Dependency Problem](https://rsdoctor.dev/blog/topic/duplicate-pkg-problem)\n- [Pnpm | How peers are resolved](https://pnpm.io/how-peers-are-resolved)\n- [如何解决项目依赖重复打包问题](https://yutengjing.com/posts/%E5%A6%82%E4%BD%95%E8%A7%A3%E5%86%B3%E9%A1%B9%E7%9B%AE%E4%BE%9D%E8%B5%96%E9%87%8D%E5%A4%8D%E6%89%93%E5%8C%85%E9%97%AE%E9%A2%98/)\n\n## License\n\n[MIT](./LICENSE) License © 2023-PRESENT [YuTengjing](https://github.com/tjx666)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftjx666%2Funplugin-detect-duplicated-deps","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftjx666%2Funplugin-detect-duplicated-deps","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftjx666%2Funplugin-detect-duplicated-deps/lists"}