Skip to content

Commit

Permalink
add cli support for --transform-key to support mode's like production…
Browse files Browse the repository at this point in the history
…/staging/etc..
  • Loading branch information
serapath committed Apr 4, 2017
1 parent a5aa660 commit 0e1a7a0
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
9 changes: 9 additions & 0 deletions bin/advanced.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,15 @@ Advanced Options:
Turn off package.json browser field resolution. This is also handy if you
need to run a bundle in node.

--transform-key

Instead of the default package.json#browserify#transform field to list
all transforms to apply when running browserify, a custom field, like, e.g.
package.json#browserify#production or package.json#browserify#staging
can be used, by for example running:
* `browserify index.js --transform-key=production > bundle.js`
* `browserify index.js --transform-key=staging > bundle.js`

--node

Alias for --bare and --no-browser-field.
Expand Down
1 change: 1 addition & 0 deletions bin/args.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ module.exports = function (args, opts) {
bundleExternal: argv['bundle-external'],
basedir: argv.basedir,
browserField: argv.browserField,
transformKey: argv['transform-key'] ? ['browserify', argv['transform-key']] : undefined,
dedupe: argv['dedupe'],

detectGlobals: argv.detectGlobals,
Expand Down
9 changes: 9 additions & 0 deletions readme.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,15 @@ Advanced Options:
Turn off package.json browser field resolution. This is also handy if you
need to run a bundle in node.
--transform-key
Instead of the default package.json#browserify#transform field to list
all transforms to apply when running browserify, a custom field, like, e.g.
package.json#browserify#production or package.json#browserify#staging
can be used, by for example running:
* `browserify index.js --transform-key=production > bundle.js`
* `browserify index.js --transform-key=staging > bundle.js`
--node
Alias for --bare and --no-browser-field.
Expand Down

0 comments on commit 0e1a7a0

Please sign in to comment.