How to override global yarn registry for particular project

后端 未结 2 805
甜味超标
甜味超标 2021-02-03 11:28

For most projects I pull packages from the internal server, so it\'s been added by

yarn config set registry http://custom-packages-server.com

But no

相关标签:
2条回答
  • 2021-02-03 11:40

    Found the way how to achieve that.

    It turned out that you can use .yarnrc file inside the project's directory (yeah, pretty much the same like .npmrc). And there you can specify custom config properties which yarn will look into first.

    So that's how my .yarnrc file looks now.

    registry "https://registry.yarnpkg.com"
    
    0 讨论(0)
  • 2021-02-03 12:00

    It is also possible to temporarily override the registry for one yarn command, without having to modify a file:

    yarn --registry=https://registry.company.com/
    
    0 讨论(0)
提交回复
热议问题