Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Google在其 CDN 上托管了许多 JavaScript 库,例如 jQuery 和 dojo 。出于某种原因,他们自己的Google Closure库似乎不包括在内。是否有 Closure 库的托管版本?
它不包括在内,因为 Closure 旨在与编译器一起使用;托管版本需要包含整个库,从而破坏了构建仅包含您需要的功能的缩小库的目的。
您可以链接到他们的存储库:
<script src='https://cdn.rawgit.com/google/closure-library/master/closure/goog/base.js'></script>
对于演示或本地开发来说已经足够好了。正如其他答案所建议的那样,生产应该使用已编译的代码,这是非常值得的。