Skip to content

Hoisting vs peerDependencies #2754

Answered by larixer
jeffrson asked this question in Q&A
Apr 14, 2021 · 2 comments · 2 replies
Discussion options

You must be logged in to vote

To prevent hoisting only a few packages, there is a workaround - you can keep the name busy at the upper-level, for example by using link: protocol, or by using an alias. In the root package.json you can have:

{
  "name": "foo",
  "workspaces": [
    "packages/*"
  ],
  "dependencies": {
    "fomantic-ui": "link:./packages"
  }
}

This will prevent hoisting fomantic-ui from workspaces to the top level. It is just an example, I'm showing you only the idea of a workaround.

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@jeffrson
Comment options

Answer selected by jeffrson
Comment options

You must be logged in to vote
1 reply
@jeffrson
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants