Skip to content

Commit eb92935

Browse files
committed
document options
1 parent 1d9dfd2 commit eb92935

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

readme.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,42 @@ browserify -p tinyify app.js
2828
- [browser-pack-flat][] - Output a "flat" bundle, with all modules in a single scope
2929
- [minify-stream][] - Uglify the final bundle
3030

31+
## Options
32+
33+
Options can be provided on the command line using subarg syntax, or in a separate options object using the browserify API.
34+
35+
### `env: {}`
36+
37+
Supply custom environment variables for [envify][].
38+
39+
```js
40+
b.plugin('tinyify', {
41+
env: {
42+
PUBLIC_PATH: 'https://mywebsite.surge.sh/'
43+
}
44+
})
45+
```
46+
47+
This option is only available in the API.
48+
On the CLI, you can define environment variables beforehand instead:
49+
50+
```bash
51+
PUBLIC_PATH=https://mywebsite.surge.sh browserify app.js -p tinyify
52+
```
53+
54+
### `--no-flat`, `flat: false`
55+
56+
Disable [browser-pack-flat][].
57+
This is useful if you want to generate a [browser-pack][] style bundle, like required by [disc][] for example.
58+
59+
```bash
60+
browserify app.js -p [ tinyify --no-flat ]
61+
```
62+
63+
```js
64+
b.plugin('tinyify', { flat: false })
65+
```
66+
3167
## License
3268

3369
[Apache-2.0](./LICENSE.md)
@@ -38,3 +74,5 @@ browserify -p tinyify app.js
3874
[common-shakeify]: https://github.com/goto-bus-stop/common-shakeify
3975
[browser-pack-flat]: https://github.com/goto-bus-stop/browser-pack-flat
4076
[minify-stream]: https://github.com/goto-bus-stop/minify-stream
77+
[browser-pack]: https://github.com/browserify/browser-pack
78+
[disc]: https://github.com/hughsk/disc

0 commit comments

Comments
 (0)