title: Webpack UglifyJsPlugin not minifying code
body: <p>I'm trying to get Webpack to minify my Javascript code when it's being run through Yarn. I believe I've got everything setup correctly, however the Javascript just isn't being minified.</p>
  
  <p>I've built a docker box to reproduce this problem: <a href="https://github.com/Danack/ReactTest" rel="nofollow noreferrer">https://github.com/Danack/ReactTest</a> (which probably doesn't work on Windows)</p>
  
  <p>I've tested that the Uglify code is working my minifying a test file by manually calling Uglify.minify(), and it is.</p>
  
  <p>This is my Webpack config file:</p>
  
  <pre class="lang-js prettyprint-override"><code>var webpack = require("webpack");
  var path = require("path");
  
  // This is just to test whether uglify is working.
  var UglifyJS = require('uglify-js');
  var fs = require('fs');
  var result = UglifyJS.minify('./src/compress_test.js', {
    mangle: true,
    compress: {
      sequences: true,
      dead_code: true,
      conditionals: true,
      booleans: true,
      unused: true,
      if_return: true,
      join_vars: true,
      drop_console: true
    }
  });
  fs.writeFileSync('./uglify_test/manual.min.js', result.code);
  
  module.exports = {
  
    entry: "./src/compress_test.js",
    devtool: "source-map",
  
    output: {
      path: path.resolve('./uglify_test'),
      filename: "[name].js"
    },
  
    plugins: [
      new webpack.optimize.UglifyJsPlugin({
        mangle: true,
        compress: {
          sequences: true,
          dead_code: true,
          conditionals: true,
          booleans: true,
          unused: true,
          if_return: true,
          join_vars: true,
          drop_console: true
        }
      })
    ]
  };
  </code></pre>
  
  <p>To build project <code>webpack -d --colors --watch --config ./webpack.config.js</code> or <code>npm run dev:build</code></p>
  
  <p>I setup a simple Javascript file that has long variable names to make it easy to see if the JS is being minified or no.</p>
  
  <pre class="lang-js prettyprint-override"><code>// compress_test.js
  function really_long_test_function_name(some_really_long_param_name_1, some_really_long_param_name_2) {
  
  
    var foo_really_long_var_name_1 = some_really_long_param_name_1 + "asdjpajdpoadpsapodjpasojdpoajpdoaspdpasjd";
    var foo_really_long_var_name_2 = some_really_long_param_name_2 + "asdjpajdpoadpsapodjpasojdpoajpdoaspdpasjd";
  
    var foo_really_long_var_name_3 = foo_really_long_var_name_1 + foo_really_long_var_name_2;
    var foo_really_long_var_name_4 = foo_really_long_var_name_1 + foo_really_long_var_name_3;
    var foo_really_long_var_name_5 = foo_really_long_var_name_1 + foo_really_long_var_name_4;
    var foo_really_long_var_name_6 = foo_really_long_var_name_1 + foo_really_long_var_name_5;
    var foo_really_long_var_name_7 = foo_really_long_var_name_1 + foo_really_long_var_name_6;
    var foo_really_long_var_name_8 = foo_really_long_var_name_1 + foo_really_long_var_name_7;
    var foo_really_long_var_name_9 = foo_really_long_var_name_1 + foo_really_long_var_name_8;
  
  
    return foo_really_long_var_name_9.length;
  }
  </code></pre>
  
  <p>The javascript produced by calling Uglify manually, is nicely minified.</p>
  
  <pre class="lang-js prettyprint-override"><code>// manual.min.js
  function really_long_test_function_name(a,p){var d=a+"asdjpajdpoadpsapodjpasojdpoajpdoaspdpasjd";return(d+(d+(d+(d+(d+(d+(d+(p+"asdjpajdpoadpsapodjpasojdpoajpdoaspdpasjd")))))))).length}
  </code></pre>
  
  <p>The built javascript output of Webpack isn't:</p>
  
  <pre class="lang-js prettyprint-override"><code>!function(l){function _(n){if(a[n])return a[n].exports;var o=a[n]={i:n,l:!1,exports:{}};return l[n].call(o.exports,o,o.exports,_),o.l=!0,o.exports}var a={};_.m=l,_.c=a,_.i=function(l){return l},_.d=function(l,a,n){_.o(l,a)||Object.defineProperty(l,a,{configurable:!1,enumerable:!0,get:n})},_.n=function(l){var a=l&amp;&amp;l.__esModule?function(){return l.default}:function(){return l};return _.d(a,"a",a),a},_.o=function(l,_){return Object.prototype.hasOwnProperty.call(l,_)},_.p="",_(_.s=0)}([/*!******************************!*\
    !*** ./src/compress_test.js ***!
    \******************************/
  function(module,exports){eval('\n\nfunction really_long_test_function_name(some_really_long_param_name_1, some_really_long_param_name_2) {\n\n\n  var foo_really_long_var_name_1 = some_really_long_param_name_1 + "asdjpajdpoadpsapodjpasojdpoajpdoaspdpasjd";\n  var foo_really_long_var_name_2 = some_really_long_param_name_2 + "asdjpajdpoadpsapodjpasojdpoajpdoaspdpasjd";\n\n  var foo_really_long_var_name_3 = foo_really_long_var_name_1 + foo_really_long_var_name_2;\n  var foo_really_long_var_name_4 = foo_really_long_var_name_1 + foo_really_long_var_name_3;\n  var foo_really_long_var_name_5 = foo_really_long_var_name_1 + foo_really_long_var_name_4;\n  var foo_really_long_var_name_6 = foo_really_long_var_name_1 + foo_really_long_var_name_5;\n  var foo_really_long_var_name_7 = foo_really_long_var_name_1 + foo_really_long_var_name_6;\n  var foo_really_long_var_name_8 = foo_really_long_var_name_1 + foo_really_long_var_name_7;\n  var foo_really_long_var_name_9 = foo_really_long_var_name_1 + foo_really_long_var_name_8;\n\n\n  return foo_really_long_var_name_9.length;\n}\n\n\n\n\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjoz **** SOURCE_MAPPING_NOT_SHOWN_HERE***')}]);
  </code></pre>
  
  <p>The long variable names are still there.</p>
  
  <p>What do I need to do to make webpack actually minify the Javascript that it outputs?</p>
  
  <p>In case it matters, I'm using Yarn 0.23.4 and Node 7.10.0</p>