How do I run a private pub server while still referencing packages from pub.dartlang.org?

混江龙づ霸主 提交于 2020-01-12 15:30:09

问题


Assuming that I'm running my own instance of pub-dartlang for a private pub feed; how do I indicate in pubspec.yaml which packages come from the private feed vs pub.dartlang.org?


回答1:


You can set the environment variable PUB_HOSTED_URL so it points to your custom pub repo server. This way pub loads all packages which don't have a server specified from this server.

You can define exceptions in pubspec.yaml like

dependencies:
  transmogrify:
    hosted:
      name: transmogrify
      url: http://some-package-server.com

see https://www.dartlang.org/tools/pub/dependencies.html for more details.

There is another package that seems to provide a custom Pub repo https://pub.dartlang.org/packages/pub_proxy_server



来源:https://stackoverflow.com/questions/26678228/how-do-i-run-a-private-pub-server-while-still-referencing-packages-from-pub-dart

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!