How to use local resolutions in yarn workspaces?

Viewed 233

I have a monorepo based on yarn workspaces, with two projects, A and B. Both projects depend on the foo package. I would like to create a resolution in the parent package.json file (since resolutions don't work on local package.json files in yarn workspaces) so that I can reference a different version of foo for each package.

Is it possible?

I have tried using something like this with no luck:

"resolutions": {
  "A/foo": "1.0.0",
  "B/foo": "2.0.0"
}

Important: This is a simplified example, I know it should be as simple as using different versions of foo in each workspace. The real use case is more complex and involves a dependency chain I cannot alter :(

0 Answers
Related