How to make Jquery work with google closure compiler

旧巷老猫 提交于 2019-11-27 02:31:28

问题


I have been going through all the posts related to GCC with JQuery but unable to find the solution. Is JQuery still not compatible to work with GCC? If not can you please refer to the appropriate link or provide an example?


回答1:


The main distribution of jQuery is not compatible with Closure-compiler ADVANCED_OPTIMIZATIONS. To use the main build of jQuery you must reference the appropriate jQuery extern file in the Closure-compiler contrib folder.

I have an experimental jQuery 1.9.1 build which IS compatible with ADAVANCED_OPTIMIZATIONS. It is available on my GitHub account.

A version of the jQuery 2.0.x branch that is compatible is under development, but not yet complete.




回答2:


Try adding this flag:

--process_jquery_primitives

https://code.google.com/p/closure-compiler/wiki/jQueryExpansions



来源:https://stackoverflow.com/questions/16461915/how-to-make-jquery-work-with-google-closure-compiler

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!