Just started to use browserify, but I cannot find documentation for how to get it spilling out minified output.
So I am looking something like:
$> browserify main.js > bundle.js --minified
Pipe it through uglifyjs:
browserify main.js | uglifyjs > bundle.js
You can install it using npm like so:
npm install -g uglify-js
As of 3.38.x you can use my minifyify plugin to minify your bundle and still have usable sourcemaps. This is not possible with the other solutions -- the best you can do is map back to the uncompressed bundle. Minifyify maps all the way back to your separate source files (yes, even to coffeescript!)
Or use uglifyify transform which "gives you the benefit applying Uglify's "squeeze" transform before it's processed by Browserify, meaning you can remove dead code paths for conditional requires."