title: How to use Watchify with Uglifyify properly?
body: <p>I am looking for a good way to do minification with browserify.</p>
  
  <p>I am developing a react application trying to keep the build setup as simple as possible.</p>
  
  <p>I am using <code>browserify</code>, <code>babelify</code> and <code>watchify</code>.
  I do not want to use a task runner like <code>grunt</code> or <code>gulp</code> but just <code>npm</code> in order to keep the setup as simple as possible.</p>
  
  <p>I would like to use the same parameters for browserify (production build) and watchify (during development). The compiled js during development should be exactly the same as in the production build (ie I want minification during development as well. And I want the strongest minification possible with browserify. I know there are other module loaders like rollup or systemjs that achieve even smaller outputs but that's not what I am interested in.</p>
  
  <p>My current <code>watch</code> command looks like this:
  <code>
  watchify src/main.js -t babelify -t envify -o build/bundle.js -v
  </code>
  the corresponding build command looks like this:
  <code>
  browserify src/main.js -t babelify -t envify -o build/bundle.js -v
  </code></p>
  
  <p>Note that all the parameters look the same. That's how I want to to be in order to keep the commands in sync in the future.</p>
  
  <p>Now my question is how to add uglification/minification.</p>
  
  <p>I tried adding uglifyify like this: <code>-g [ uglifyify --no-sourcemap ]</code> but there are still a lot of line breaks in the output so I guess it's not fully minified.</p>
  
  <p>I also tried removing the <code>-o</code> parameter and piping the output throught uglifyjs <a href="https://stackoverflow.com/a/15592279/1533291">as described here</a>. This produces a smaller output but it does not work for the <code>watchify</code> command.</p>