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

前端 未结 1 1152
北海茫月
北海茫月 2021-02-20 03:03

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 p

相关标签:
1条回答
  • 2021-02-20 03:35

    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

    0 讨论(0)
提交回复
热议问题