A Yarn plugin to automatically deduplicate dependencies.
Ideally, this functionality would be built into yarn (see yarnpkg/berry#4976).
The lack of an auto-dedupe also causes problems with Dependabot PRs (see dependabot/dependabot-core#5830). You can configure this plugin to run only on dependabot PRs (see usage).
Download the latest release: Latest Release
You can install this plugin using:
yarn plugin import https://github.com/blimmer/yarn-plugin-dedupe/releases/download/v1.0.0/plugin-dedupe.jsBy default, the plugin will automatically dedupe after all commands that install packages.
You can configure this behavior in your .yarnrc.yml file via the dedupePluginMode configuration
option.
| Option | Behavior |
|---|---|
always (default) |
yarn dedupe is run after every yarn install command |
dependabot-only |
yarn dedupe is run only in GitHub Actions-based dependabot update commands |
never |
automatic dedupe is disabled |
# .yarnrc.yml
dedupePluginMode: dependabot-onlyMIT