gpt4 book ai didi

flutter - 如何为 Dart/Flutter 包设置镜像/公司范围的缓存?

转载 作者:行者123 更新时间:2023-12-03 03:00:19 24 4
gpt4 key购买 nike

有没有办法为 pub.dev 包设置公司范围的缓存,而无需镜像整个 pub.dev 存储库?

我看到有一个社区贡献的 pub_mirror包裹。但是那个下载了整个 pub.dev,这完全是矫枉过正。

好像有一个pub_server来自 Google 本身的包,其中有一个 example.dart 似乎可以满足我的要求:

An experimental pub server based on a file system can be found in example/example.dart. It uses a filesystem-based PackageRepository for storing packages and has a read-only fallback to the real pub.dartlang.org site, if a package is not available locally. This allows one to use all pub.dartlang.org packages and have additional ones, on top of the publicly available packages, available only locally.



但是那个是存档的,实验性的,不再有贡献了。那么我如何在公司范围内缓存 pub 包呢?

非常感谢你的帮助! :-)

最佳答案

我唯一能想到的接近的是this .

您可以在 GitHub 上私下托管您的包,并为需要它们的每个人提供访问权限。

把这样的东西放在你的 pubspec.yaml .

dependencies:
kittens:
git:
url: git://github.com/munificent/kittens.git
ref: some-branch

关于flutter - 如何为 Dart/Flutter 包设置镜像/公司范围的缓存?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62023524/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com