开发者

Why isn't Google's Closure library hosted on their CDN?

开发者 https://www.devze.com 2022-12-19 05:31 出处:网络
Google hosts a number of JavaScript libraries such as jQuery and dojo on their CDN.For some reason, their own Google Closure library does no开发者_JAVA技巧t seem to be included.Is there a hosted versi

Google hosts a number of JavaScript libraries such as jQuery and dojo on their CDN. For some reason, their own Google Closure library does no开发者_JAVA技巧t seem to be included. Is there a hosted version of the Closure library?


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:

<script src='https://cdn.rawgit.com/google/closure-library/master/closure/goog/base.js'></script>

good enough for demos or local development. As other answer suggested, production should use compiled code, it is well worth it.

0

精彩评论

暂无评论...
验证码 换一张
取 消