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 !
More Related Contents:
- Tool to Unminify / Decompress JavaScript [closed]
- jQuery compiled with Google Closure Compiler
- How do I split my javascript into modules using Google’s Closure Compiler?
- Does it make sense to minify code used in NodeJS?
- unpack packed scripts with javascript function [duplicate]
- JavaScript implementation of Gzip [closed]
- How to compress an image via Javascript in the browser?
- Is there a good JavaScript minifier? [closed]
- Best JavaScript compressor [closed]
- Decompress gzip and zlib string in javascript
- difference between “void 0 ” and “undefined”
- How do I concatenate JavaScript files into one file?
- Angular.module minification bug
- Is there any point of using “return !0” in javascript?
- What do you use to minimize and compress JavaScript libraries? [closed]
- Uncaught TypeError: undefined is not a function on loading jquery-min.js
- Is there a plugin that allows me to automatically unminify the Javascript included on a site? [closed]
- How to concatenate and minify multiple CSS and JavaScript files with Grunt.js (0.3.x)
- ZLIB Decompression – Client Side
- Running a command in a Grunt Task
- How can I use deflated/gzipped content with an XHR onProgress function?
- How to get the children of the $(this) selector?
- Getting the ID of the element that fired an event
- How to convert a string to an integer in JavaScript?
- Extending Error in Javascript with ES6 syntax & Babel
- tag vs tag
- How to create new instance of an extended class of custom elements
- Regular expression for number with length of 4, 5 or 6
- How do you completely remove Ionic and Cordova installation from mac?
- How to hide optgroup/option elements?