I'm working on a large project using yarn workspaces. I know that yarn workspaces essentially does two things
- It automates the symlinking process we had to do manually years ago when we want to share private packages
- It hoists all similar packages at the top in
node_modulesin order to be more efficient.
However, I have noticed that my packages still contain code in their own node_modules and I'm not sure why. When I make a sample monorepo app and say I install lodash in one, it goes straight to the root node_modules.
Why and when does yarn decide to install a package inside a package's node_modules ?