How do I override nested dependencies with `yarn`?

前端 未结 3 730
独厮守ぢ
独厮守ぢ 2020-12-05 03:58

If my package has these dependencies

{ \"name\": \"my-package\",
  \"dependencies\": { \"foobar\":\"~1.0.3\", \"baz\":\"2.0.9\" }

And the <

3条回答
  •  醉话见心
    2020-12-05 04:37

    This is now possible with yarn's selective version resolution feature.

    In your project's package.json, use resolutions:

      "resolutions": {
        "foobar/**/baz": "2.0.9"
      }
    

    This overrides package foobar's (and any other packages under it) version of baz, forcing it to be version 2.0.9.

提交回复
热议问题