here’s the (ultimate) answer for closure compiler :
/** @const */
var LOG = false;
...
LOG && log('hello world !'); // compiler will remove this line
...
this will even work with SIMPLE_OPTIMIZATIONS
and no --define=
is necessary !
here’s the (ultimate) answer for closure compiler :
/** @const */
var LOG = false;
...
LOG && log('hello world !'); // compiler will remove this line
...
this will even work with SIMPLE_OPTIMIZATIONS
and no --define=
is necessary !