I copy-pasted my js code into the google compiler and when I copied it back into my application it didn\'t work. I realized that my code needs jquery so I copied the jquery code
Use @externs_url
to "import" symbols in Google's Closure compiler:
// @externs_url https://raw.githubusercontent.com/google/closure-compiler/master/contrib/externs/jquery-1.9.js
I recommend to use one of the externs as defined in contrib/externs, which only includes the names of all methods.
// ==ClosureCompiler==
// @compilation_level ADVANCED_OPTIMIZATIONS
// @externs_url https://raw.githubusercontent.com/google/closure-compiler/master/contrib/externs/jquery-1.9.js
// ==/ClosureCompiler==
$(document).ready(function(){alert(0);}); // Input
Output:
$(document).ready(function(){alert(0)});