Skip to content

Commit

Permalink
Add a --minify option to the bundle CLI command
Browse files Browse the repository at this point in the history
If specified, this flag will override the `--dev` flag. Otherwise, the existing behavior remains the default.
  • Loading branch information
swansontec committed Oct 18, 2017
1 parent 63848bd commit bdc4139
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion local-cli/bundle/buildBundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ function buildBundle(
entryFile: args.entryFile,
sourceMapUrl,
dev: args.dev,
minify: !args.dev,
minify: args.minify != null ? args.minify : !args.dev,
platform: args.platform,
};

Expand Down
4 changes: 4 additions & 0 deletions local-cli/bundle/bundleCommandLineArgs.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ module.exports = [
description: 'If false, warnings are disabled and the bundle is minified',
parse: (val) => val === 'false' ? false : true,
default: true,
}, {
command: '--minify [boolean]',
description: 'Enable or disables minification, overriding "--dev"',
parse: (val) => val === 'false' ? false : true
}, {
command: '--bundle-output <string>',
description: 'File name where to store the resulting bundle, ex. /tmp/groups.bundle',
Expand Down

0 comments on commit bdc4139

Please sign in to comment.