Hoisting only hoists shared deps to root
Hoisting hoists deps to root even if only used in one package
Modify the docs to reflect that this is how it works.
https://github.com/lerna/lerna/blob/master/doc/hoist.md
node_moduleslerna.json
<!-- Please paste your `lerna.json` here -->
{
"packages": [
"packages/*"
],
"version": "0.0.17"
}
I wanted to understand what to cache in CI (in other words, where to expect to find most of the data in node_modules - the root or the child packages. The docs were misleading and made me think most of the content would be in the child package dirs.
| Executable | Version |
| ---: | :--- |
| lerna --version | 3.13.4 |
| npm --version | 6.9.0 |
| yarn --version | n/a |
| node --version | 10.15 |
-->
Quoting from the current docs:
Lerna can reduce the time and space requirements for numerous copies of packages in development and build environments, by "hoisting" shared dependencies up to the topmost, Lerna-project-level
node_modulesdirectory instead.
Is that not clear?
npm packges only used in a single child package show up in the root
node_modules
This is _exactly_ how it should work.
@evocateur Thanks for the explanation. Ah yeah, then it’s the docs that could be clearer. If we remove the word “shared” it would be clear. Because even those that aren’t shared by another package get hoisted.
Sure, that's a good change.
Most helpful comment
Sure, that's a good change.