Is jQuery 1.4.2 compatible with the Closure compiler?

According to the official instructions, version 1.4 was overwritten for compression along with the Closure Compiler, when I use the online version of the closing compiler, I get 130 warnings.

This is the code I'm using.

// ==ClosureCompiler==
// @compilation_level ADVANCED_OPTIMIZATIONS
// @output_file_name default.js
// @code_url http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.js
// ==/ClosureCompiler==

And as far as I know, you get real benefits from the Closure Compiler if you also include a library with your code to remove unused functions. However, my testimony shows that I can get nothing but the compression of the library itself.

What am I doing wrong? Any kind of insight will be appreciated.

+3
source share
2 answers

jQuery 1.4 is compatible with the Closure compiler, but only with customization SIMPLE_OPTIMIZATIONS. The official jQuery mini version is actually compiled with this option, and this reduces the file size by 13%. Quote from this comment comment from John Resig:

Switching with YUI Compressor to Google Compiler. Minimized and Gzipped size reduced to 22,839 bytes from 26,169 bytes (decrease of 13% in files).

+10
source

jQuery is not (yet) compatible with the Closure compiler in advanced mode. I agree that it would be very convenient to make it compatible, because its method-bound syntax very easily provides a virtualization prototype for significantly improved execution speed.

, JavaScript ( Closure), Dojo Toolkit Closure Advanced.

http://dojo-toolkit.33424.n3.nabble.com/file/n2636749/Using_the_Dojo_Toolkit_with_the_Closure_Compiler.pdf?by-user=t

+2

Source: https://habr.com/ru/post/1739746/


All Articles