Browserify, minifyify, conditional compilation
<h2>TL;DR</h2>

<p>minifyify (<em>the Browserify plugin</em>) makes use of <strong>uglify-js</strong> but appears to be unable to handle <strong><a href="https://github.com/mishoo/UglifyJS2#conditional-compilation" rel="noreferrer">Conditional compilation</a></strong>:</p>

<ul>
<li>compression works</li>
<li>uglifyjs alone works for conditional compilation</li>
<li>minifyify provides additional compilation optimization but I have been unable to use conditional compilation with it</li>
</ul>

<hr>

<p>I'm using <strong>Browserify</strong> with the <strong>babelify</strong> transformer and the <strong>minifyify</strong> plugin. Here is the cmd, broken down in readable parts:</p>

<p><code>browserify 
src/scripts/app/index.js 
-o 
build/prod/public/assets/js/appBundle.min.js 
-t 
[ babelify --presets [ es2015 ] ] 
-p 
[ minifyify --no-map --uglify [ --compress [ --drop_console --dead_code --conditionals --unused --if_return ] --mangle --screw-ie8 --define [ DEBUG=false ] ] ]</code></p>

<p>I've gotten every setting/option to work. However, <strong>I am unable to get conditional compilation to work</strong>.
Minifyify uses uglifyjs' <code>minify</code> method. The fact I'm passing by minifyify shouldn't really change anything.</p>

<h2>Building directly through uglifyjs works</h2>

<p><code>uglifyjs input.js --compress --dead_code --define DEBUG=false -o output.js</code></p>

<p>But then I lose the additional compressions/optimizations provided by minifyify.</p>

<p><strong>I'm also open to another build process. My needs are resumed in the settings of the current process:</strong></p>

<ul>
<li>CommonJS required modules</li>
<li>transpiling of ES6 to ES5</li>
<li>advanced minification/compression</li>
</ul>