[Feature] Add option to automatically apply dedupe strategy on add/remove cli command #2770
Closed
2 tasks done
Labels
enhancement
New feature or request
Describe the user story
As a developer, I always run
yarn dedupe
after adding, removing, or updating packages. I perform ayarn dedupe --check
in CI to prevent unnecessarily duplicated packages from ending up in my production environment. This creates unnecessary complexity.Describe the solution you'd like
Introduce a new config property to
.yarnrc.yml
that lets you specify the dedupe strategy used in theyarn add
command.Describe the drawbacks of your solution
If we default the stategy to "none" / "off", I don't see any drawbacks. Perhaps main drawback would be coupling
dedupe
withadd
, which are currently quite isolated in the codebase.Describe alternatives you've considered
postinstall
script to run dedupe: only want to run it in development and don't want to unnecessarily run it if packages haven't changed.Custom plugin: it's an option and would be quite easy to implement, but this seems like it'd be valuable in the yarn core.
The text was updated successfully, but these errors were encountered: