为什么 Google 的 Closure 库没有托管在他们的 CDN 上?
Google 在其 CDN 上托管了许多 JavaScript 库,例如 jQuery 和 dojo。由于某种原因,他们自己的 Google Closure 库似乎未包含在内。 Closure 库有托管版本吗?
Google hosts a number of JavaScript libraries such as jQuery and dojo on their CDN. For some reason, their own Google Closure library does not seem to be included. Is there a hosted version of the Closure library?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不包含它是因为 Closure 旨在与编译器一起使用;托管版本需要包含整个库,并且无法实现构建仅包含您需要的功能的缩小库的目的。
It's not included because Closure is intended to be used with the compiler; a hosted version would need to include the entire library and defeat the purpose of building minified libraries containing only the features you need.
您可以链接到他们的存储库:
足以用于演示或本地开发。
正如其他答案所建议的,生产应该使用编译代码,这是非常值得的。
You can link to their repository:
good enough for demos or local development.
As other answer suggested, production should use compiled code, it is well worth it.