7

Just upgraded from Yarn 1 to Yarn 3.

In my package.json of my "Project 1" I have a dependencies to my published package

dependencies: {
  ...
  "@my-package/name": "3.4"
  ...
}

With Yarn 1 not altering package.json when linking "Project 1" to "@my-package/name" for local development, that worked fine.

Linking my local version of the package with Yarn 2/3, it now added

  "resolutions": {
    "@my-package/name": "portal:../name"
  }

This breaks the build process during deployment on staging/production environments. That link is only meant for local development, while on other environments it should be ignored and (only) the published package above should be used. Any idea if / how this is now possible?

Here is the ticket on that issue/change https://github.com/yarnpkg/berry/issues/90

jonrsharpe
  • 115,751
  • 26
  • 228
  • 437
retrovertigo
  • 538
  • 9
  • 20

1 Answers1

3

In yarn 3, I tried:

yarn link ~/local/package/path

It added:

"resolutions": {
  "@namespace/package": "portal:/home/src/repo/local/package/path"
}

was working for me to deploy in staging env for testing. (Note: We have different setup for prod)

Srikanth Sharma
  • 1,509
  • 2
  • 15
  • 27