问题描述
假设我正在运行我自己的用于私人酒吧Feed;我如何在 pubspec.yaml
中指明哪些包来自私人Feed vs pub.dartlang.org?
您可以设置环境变量 PUB_HOSTED_URL
,因此它指向您的自定义pub仓库服务器。这种方式 pub
加载所有没有从此服务器指定的服务器的软件包。
在 pubspec.yaml
如
:
pre>
幻化:
托管:
名称:transmogrify
url:http://some-package-server.com
请参阅了解详情。
还有另一个软件包似乎提供了自定义的Pub repo
Assuming that I'm running my own instance of
pub-dartlang
for a private pub feed; how do I indicate inpubspec.yaml
which packages come from the private feed vs pub.dartlang.org?解决方案You can set the environment variable
PUB_HOSTED_URL
so it points to your custom pub repo server. This waypub
loads all packages which don't have a server specified from this server.You can define exceptions in
pubspec.yaml
likedependencies: 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
这篇关于如何在仍引用来自pub.dartlang.org的包时运行私有pub服务器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!