Skip to content

Deduplicate packages with peer dependencies #6152

Description

@zkochan

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions