title: Webpack: How can we *conditionally* use a plugin?
body: <p>In Webpack, I have the following plugins:</p>
  
  <pre><code>plugins: [
          new ExtractTextPlugin('styles.css'),
          new webpack.optimize.UglifyJsPlugin({
              compress: {
                  warnings: false
              },
              drop_console: true,
          }),
      ]
  </code></pre>
  
  <p>I would like to apply the <code>UglifyJsPlugin</code> <strong>only for a specific target</strong>, so I tried using my intended conditional:</p>
  
  <pre><code>plugins: [
          new ExtractTextPlugin('styles.css'),
          (TARGET === 'build') &amp;&amp; new webpack.optimize.UglifyJsPlugin({
              compress: {
                  warnings: false
              },
              drop_console: true,
          }),
      ]
  </code></pre>
  
  <p>However, this fails, showing the following error message:</p>
  
  <pre><code>E:\myProject\node_modules\tapable\lib\Tapable.js:164
              arguments[i].apply(this);
                           ^
  
  TypeError: arguments[i].apply is not a function
  </code></pre>
  
  <p>Note that the above code is similar to having <code>false</code> at the end of the <code>plugins</code> array (which emits the same error):</p>
  
  <pre><code>plugins: [
          new ExtractTextPlugin('styles.css'),
          false
      ]
  </code></pre>
  
  <p>So, the question is:
  Is there a way to have conditional plugins on Webpack? (other than using variables?)</p>