Currently, when a package depends on peer dependencies, it may happen that there will be multiple copies of this package inside node_modules. The reason this happens is that the package might be used by multiple packages. In some places of the dependency graph it will resolve its dependency while in other places it won't.
For instance, webpack has webpack-cli as a peer dependency. webpack is a direct dep of the project and also a dependency of foo. foo has also webpack-cli in dependencies. In this case we will get to directories for webpack inside node_modules.pnpm:
webpack@1.0.0
webpack@1.0.0_webpack-cli@1.0.0
This causes issues, so we need to probably to create only one webpack that uses webpack-cli. Even if webpack-cli is not resolved in some parts of the dependency graph
Currently, when a package depends on peer dependencies, it may happen that there will be multiple copies of this package inside node_modules. The reason this happens is that the package might be used by multiple packages. In some places of the dependency graph it will resolve its dependency while in other places it won't.
For instance,
webpackhaswebpack-clias a peer dependency.webpackis a direct dep of the project and also a dependency offoo.foohas alsowebpack-cliin dependencies. In this case we will get to directories for webpack insidenode_modules.pnpm:This causes issues, so we need to probably to create only one webpack that uses
webpack-cli. Even if webpack-cli is not resolved in some parts of the dependency graph