convert bundle paths to IDs to save bytes in browserify bundles
example
The easiest way to use bundle-collapser is from the plugin:
$ browserify -p bundle-collapser/plugin main.js
Instead of the usual output which would have the original require('./foo.js')
style calls in it, the output just has require(2) style paths, which minifies
more compactly:
There is also a command-line program included in this distribution:
usage: bundle-collapser {FILE | -} {OPTIONS} Collapse a browser-pack/browserify bundle from STDIN or a FILE.OPTIONS: -h --help Show this message.
methods
var collapse = require('bundle-collapser')
var stream = collapse(src)
Return a readable stream of output from
browser-pack with the input source
string src converted to have its require() calls collapsed down to the
dependency targets in the "deps" fields from the unpacking.