What is the current behavior?
In a monorepo, yarn workspace doesn't hoist one of my dependency & duplicate it on each workspace. I don't understand why.
yarn why react-native-reanimated
yarn why v1.22.19
[1/4] 🤔 Why do we have the module "react-native-reanimated"...?
[2/4] 🚚 Initialising dependency graph...
[3/4] 🔍 Finding dependency...
[4/4] 🚡 Calculating file sizes...
=> Found "react-native-reanimated@3.4.2"
info Reasons this module exists
- "_project_#app1" depends on it
- Hoisted from "_project_#app1#react-native-reanimated"
- Hoisted from "_project_#app2#react-native-reanimated"
- Hoisted from "_project_#app3#react-native-reanimated"
- Hoisted from "_project_#storybook#react-native-reanimated"
info Disk size without dependencies: "6.02MB"
info Disk size with unique dependencies: "6.02MB"
info Disk size with transitive dependencies: "6.02MB"
info Number of shared dependencies: 44
✨ Done in 0.56s.
"why" command say that "react-native-reanimated" dep is hoisted. But if I try to find react-native-reanimated into node_modules I found multiple record:
So it's not hoisted to root node_modules...
I use the exact same version of "react-native-reanimated" in my workspaces. My only doubt is about peer dependencies of third party dependencies.
If I try to found every ref of this deps, I found that:
What is the current behavior? In a monorepo, yarn workspace doesn't hoist one of my dependency & duplicate it on each workspace. I don't understand why.
"why" command say that "react-native-reanimated" dep is hoisted. But if I try to find react-native-reanimated into node_modules I found multiple record:
So it's not hoisted to root node_modules... I use the exact same version of "react-native-reanimated" in my workspaces. My only doubt is about peer dependencies of third party dependencies.
If I try to found every ref of this deps, I found that:
and most of third party libs are referencing react-native-reanimated as peer or dev dependency...
So Why this lib is not hoisted at root ?
Node version: 16 Yarn version: 1.22.19