Skip to content

blimmer/yarn-plugin-dedupe

Repository files navigation

yarn-plugin-dedupe

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).

Installation

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.js

Usage

By 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

Example

# .yarnrc.yml
dedupePluginMode: dependabot-only

License

MIT

About

Dedupe Yarn Berry dependencies automatically

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors