Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make Jquery work with google closure compiler

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?

like image 537
user2109546 Avatar asked May 09 '13 12:05

user2109546


2 Answers

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.

like image 154
Chad Killingsworth Avatar answered Nov 14 '22 07:11

Chad Killingsworth


Try adding this flag:

--process_jquery_primitives

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

like image 1
f0ster Avatar answered Nov 14 '22 08:11

f0ster