I've followed the advice from this other SO thread to remove console.log()
statements from my code.
Unfortunately, now Closure compiler is removing my entire code and not just the console.log()
statements.
Might someone explain this? I'm at a loss...
JS file 1
(function(){
/** @const */
LOG = false;
function log() {
return console.log.apply(console, arguments);
}
LOG && log('hello world !');
var foo='bar';
LOG && log("foo"+foo);
})();
JS file 2
(function(){
/** @const */
LOG = false;
function test(){
alert('testing...');
}
var baz='bazzy';
LOG && log("baz"+baz);
})();
Closure compiler step:
$ java -jar compiler-latest/compiler.jar --js j1.js j2.js --js_output_file compiled.js
Result:
(function(){LOG=!1})();(function(){LOG=!1})();