⚠️ This version has a performance regression fixed in >=v6.20.4.
Minor Changes
-
New property supported via the
dependenciesMeta
field ofpackage.json
:injected
. Wheninjected
is set totrue
, the package will be hard linked tonode_modules
, not symlinked #3915.For instance, the following
package.json
in a workspace will create a symlink tobar
in thenode_modules
directory offoo
:{ "name": "foo", "dependencies": { "bar": "workspace:1.0.0" } }
But what if
bar
hasreact
in its peer dependencies? If all projects in the monorepo use the same version ofreact
, then no problem. But what ifbar
is required byfoo
that usesreact
16 andqar
withreact
17? In the past, you'd have to choose a single version of react and install it as dev dependency ofbar
. But now with theinjected
field you can injectbar
to a package, andbar
will be installed with thereact
version of that package.So this will be the
package.json
offoo
:{ "name": "foo", "dependencies": { "bar": "workspace:1.0.0", "react": "16" }, "dependenciesMeta": { "bar": { "injected": true } } }
bar
will be hard linked into the dependencies offoo
, andreact
16 will be linked to the dependencies offoo/node_modules/bar
.And this will be the
package.json
ofqar
:{ "name": "qar", "dependencies": { "bar": "workspace:1.0.0", "react": "17" }, "dependenciesMeta": { "bar": { "injected": true } } }
bar
will be hard linked into the dependencies ofqar
, andreact
17 will be linked to the dependencies ofqar/node_modules/bar
.
Patch Changes
- Buffer warnings fixed #3932.