Skip to content

Commit 5e571df

Browse files
committed
"eject" tips
1 parent 1d8c016 commit 5e571df

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

readme.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,36 @@ browserify app.js -p [ tinyify --no-flat ]
6868
b.plugin('tinyify', { flat: false })
6969
```
7070

71+
## More options?
72+
73+
If you need further customisation, I recommend installing the tools separately instead:
74+
75+
```bash
76+
npm install --save-dev unassertify envify uglifyify common-shakeify browser-pack-flat uglify-js
77+
browserify entry.js \
78+
-g unassertify \
79+
-g envify \
80+
-g uglifyify \
81+
-p common-shakeify \
82+
-p browser-pack-flat/plugin \
83+
| uglifyjs -cm \
84+
> output.js
85+
```
86+
87+
Or with the Node API:
88+
89+
```js
90+
browserify('entry.js')
91+
.transform('unassertify', { global: true })
92+
.transform('envify', { global: true })
93+
.transform('uglifyify', { global: true })
94+
.plugin('common-shakeify')
95+
.plugin('browser-pack-flat/plugin')
96+
.bundle()
97+
.pipe(require('minify-stream')())
98+
.pipe(fs.createWriteStream('./output.js'))
99+
```
100+
71101
## License
72102

73103
[Apache-2.0](./LICENSE.md)

0 commit comments

Comments
 (0)