Minifyify
Tiny, Debuggable Browserify Bundles
Before, browserify made you choose between sane debugging and sane load times. Now, you can have both.
Minifyify minifies your bundle and pulls the source map out into a separate file. Now you can deploy a minified bundle in production, and still have a sourcemap handy for when things inevitably break!
Known Issues
There is an issue in browserify
that results in broken sourcemaps. Use my patched fork until the PR gets merged.
Usage
var browserify = require('browserify')
, minifyify = require('minifyify')
, path = require('path')
, bundle = new browserify()
, transforms = [require('hbsfy')]
, opts = {
file: '/bundle.js'
, map: '/bundle.map'
, compressPaths: function (p) {
return path.relative('./www', p);
}
, transforms: transforms
};
bundle.add('entryScript.js');
minifyify(bundle, opts, function(code, map) {
fs.writeFileSync('www/bundle.js', code);
fs.writeFileSync('www/bundle.map', map);
});
License
MIT