[Feature] Add option to yarn install
to avoid hoisting deep dependencies
#4423
Labels
enhancement
New feature or request
Describe the user story
Today I've encountered an issue when moving from NPM to Yarn with a project. Yarn tries to hoist deep dependencies and doing so breaks some build actions that depend on these packages.
I'll show a brief example:
svelte-material-ui@4.2.0
have@smui/textfield@4.2.0
as direct dependency@smui-extra/autocomplete@6.0.0-beta.16
have@smui/textfield@6.0.0-beta.16
as direct dependency tooNow, when performing
yarn install
, @smui/textfield on the root of node_modules is at version 6.0.0-beta.16 but I want it to be at version 4.2.0. @smui-extra/autocomplete dependencies should be completely isolated from the rest of the root dependencies in order to not interfere with them.Describe the solution you'd like
I'd like to have an option when performing a
yarn add
that allows to avoid hoisting deep dependencies, in order to share multiple package versions for multiple direct dependencies.Describe the drawbacks of your solution
There's one drawback to my solution, that is the increased bundle size of the node_modules folder due to duplication of dependencies.
Describe alternatives you've considered
I've researched alternatives for over a day but found none. Also, I think that this issue can be related to this feature request
The text was updated successfully, but these errors were encountered: