-
Hi, "fomantic-ui" cannot be installed with yarn/yarn2/npm7, but that's another story. Once, I installed it with npm6 and it works inside its own module. With yarn1, we had a "nohoist" entry in the root of the workspace:
which worked quite flawlessly. However, "nohoist" is deprecated now (I read how it was related to React Native a.s.o.). The new
on the one hand prevents hoisting of all dependencies of the respective package. Not too good, but bearable. On the other hand, if there's a "peerDependency" inside this same new package.json all depending packages cause "fomantic-ui" hoisted to the root of the workspace as well as being kept locally. Unfortunately the package does not work inside the workspace root (which is the very reason for limiting it being hoisted). Did I something wrong? Or might it be a bug in yarn (2.4.1)? Are there any recommendations? BTW, with pnp, hoisting is always to the root of the workspace, isn't it? That again will be a problem with fomantic-ui (since it will not work there...). |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
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 {
"name": "foo",
"workspaces": [
"packages/*"
],
"dependencies": {
"fomantic-ui": "link:./packages"
}
} This will prevent hoisting |
Beta Was this translation helpful? Give feedback.
-
No, it seems like everything is behaving as intended. There was work done to improve
With PnP there is no hoisting as the layout on disk doesn't matter, it just points to packages in the cache which gives you perfect deduplication |
Beta Was this translation helpful? Give feedback.
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 rootpackage.json
you can have: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.