@@ -26,8 +26,12 @@ browserify -p tinyify app.js
2626 - [ uglifyify] [ ] - Remove dead code from modules
2727 - [ common-shakeify] [ ] - Remove unused exports from modules
2828 - [ browser-pack-flat] [ ] - Output a "flat" bundle, with all modules in a single scope
29+ - [ bundle-collapser] [ ] - When using the ` --no-flat ` option, bundle-collapser replaces file paths in ` require() ` calls with short module IDs
2930 - [ minify-stream] [ ] - Uglify the final bundle
3031
32+ [ browser-pack-flat] [ ] and [ bundle-collapser] [ ] are both not used if the ` --full-paths ` option is passed to Browserify.
33+ This way you can still get all of tinyify's other optimizations when building for [ disc] [ ] .
34+
3135## Options
3236
3337Options can be provided on the command line using subarg syntax, or in a separate options object using the browserify API.
@@ -54,7 +58,7 @@ PUBLIC_PATH=https://mywebsite.surge.sh browserify app.js -p tinyify
5458### ` --no-flat ` , ` flat: false `
5559
5660Disable [ browser-pack-flat] [ ] .
57- This is useful if you want to generate a [ browser-pack ] [ ] style bundle, like required by [ disc ] [ ] for example .
61+ This enables [ bundle-collapser ] [ ] instead which will still shrink the output bundle a bit by replacing file paths with short module IDs .
5862
5963``` bash
6064browserify app.js -p [ tinyify --no-flat ]
@@ -73,6 +77,7 @@ b.plugin('tinyify', { flat: false })
7377[ uglifyify ] : https://github.com/hughsk/uglifyify
7478[ common-shakeify ] : https://github.com/browserify/common-shakeify
7579[ browser-pack-flat ] : https://github.com/goto-bus-stop/browser-pack-flat
80+ [ bundle-collapser ] : https://github.com/substack/bundle-collapser
7681[ minify-stream ] : https://github.com/goto-bus-stop/minify-stream
7782[ browser-pack ] : https://github.com/browserify/browser-pack
7883[ disc ] : https://github.com/hughsk/disc
0 commit comments