Saturday, December 1, 2012

Using the google closure compiler

java -jar ~/apps/google-closure-compiler/compiler.jar --compilation_level ADVANCED_OPTIMIZATIONS --js=../src/main/webapp/resources/evercookie/evercookie.js --js_output_file=out_advanced.js

You must define externs if you plan to compile your code separate from say for instance jquery.
http://closure-compiler.googlecode.com/svn/trunk/contrib/externs/jquery-1.8.js
--externs src/main/config/jquery-1.8.js

Make sure to define global properties that you need between source files like below for the closure compiler to work properly with
advanced optimizations
window['someobject'] = someobject;

No comments:

Post a Comment