Skip to content

Commit

Permalink
document options
Browse files Browse the repository at this point in the history
  • Loading branch information
goto-bus-stop committed Oct 21, 2017
1 parent 1d9dfd2 commit eb92935
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,42 @@ browserify -p tinyify app.js
- [browser-pack-flat][] - Output a "flat" bundle, with all modules in a single scope
- [minify-stream][] - Uglify the final bundle

## Options

Options can be provided on the command line using subarg syntax, or in a separate options object using the browserify API.

### `env: {}`

Supply custom environment variables for [envify][].

```js
b.plugin('tinyify', {
env: {
PUBLIC_PATH: 'https://mywebsite.surge.sh/'
}
})
```

This option is only available in the API.
On the CLI, you can define environment variables beforehand instead:

```bash
PUBLIC_PATH=https://mywebsite.surge.sh browserify app.js -p tinyify
```

### `--no-flat`, `flat: false`

Disable [browser-pack-flat][].
This is useful if you want to generate a [browser-pack][] style bundle, like required by [disc][] for example.

```bash
browserify app.js -p [ tinyify --no-flat ]
```

```js
b.plugin('tinyify', { flat: false })
```

## License

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

0 comments on commit eb92935

Please sign in to comment.