Yarn PNP: Possible alternative to yarn link
for use cases where symlinks won't work
#6642
Labels
yarn link
for use cases where symlinks won't work
#6642
Do you want to request a feature or report a bug?
Request a feature
What is the current behavior?
At least as of Yarn
1.12.1
, if I try to useyarn link [package name]
in a PnP project, it will still create a symlinkIf the current behavior is a bug, please provide the steps to reproduce.
I don't view it as being a "bug"
What is the expected behavior?
For cases like React Native projects (see: facebook/metro#1), symlinks are sadly not an option.
This can be awkward if you would like to
yarn link
a dependency that you are working on locally. For cases like this, Wix developed a tool calledwml
that uses Watchman to watch for changes and copy files from the dev folder to a destination folder (e.g. innode_modules
). But that has its own set of issues as well. (see the section at the bottom of this article)If there could be an option for
yarn link
to instead add a module in an arbitrary location to the pnp lookup file, I think this could be a good alternative to symlinks in cases like this. (I do see people perhaps wanting actual symlinks to be still supported though, so perhaps both behaviours could be supported?)Metro does not yet have PnP resolver support (as far as I know, at least), and a lot of other parts of React Native don't yet have support for it, but when they do they could hypothetically take advantage of this.
Please mention your node.js, yarn and operating system version.
Node: 10.11.0
Yarn: 1.12.1
OS: macOS 10.13.6
The text was updated successfully, but these errors were encountered: