@@ -26,8 +26,12 @@ browserify -p tinyify app.js
26
26
- [ uglifyify] [ ] - Remove dead code from modules
27
27
- [ common-shakeify] [ ] - Remove unused exports from modules
28
28
- [ 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
29
30
- [ minify-stream] [ ] - Uglify the final bundle
30
31
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
+
31
35
## Options
32
36
33
37
Options 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
54
58
### ` --no-flat ` , ` flat: false `
55
59
56
60
Disable [ 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 .
58
62
59
63
``` bash
60
64
browserify app.js -p [ tinyify --no-flat ]
@@ -73,6 +77,7 @@ b.plugin('tinyify', { flat: false })
73
77
[ uglifyify ] : https://github.com/hughsk/uglifyify
74
78
[ common-shakeify ] : https://github.com/browserify/common-shakeify
75
79
[ browser-pack-flat ] : https://github.com/goto-bus-stop/browser-pack-flat
80
+ [ bundle-collapser ] : https://github.com/substack/bundle-collapser
76
81
[ minify-stream ] : https://github.com/goto-bus-stop/minify-stream
77
82
[ browser-pack ] : https://github.com/browserify/browser-pack
78
83
[ disc ] : https://github.com/hughsk/disc
0 commit comments