Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a --minify option to the bundle CLI command #16456

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion local-cli/bundle/buildBundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ function buildBundle(
assetsDest: mixed,
entryFile: string,
maxWorkers: number,
minify: ?boolean,
resetCache: boolean,
transformer: string,
},
Expand All @@ -85,7 +86,7 @@ function buildBundle(
entryFile: args.entryFile,
sourceMapUrl,
dev: args.dev,
minify: !args.dev,
minify: args.minify != null ? args.minify : !args.dev,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

property minify Property cannot be accessed on any member of intersection type intersection

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops! Just pushed a fixed version.

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: 'Enables or disables minification, overriding "--dev"',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'overriding "--dev"'? May be better something like '(default: false for development build, otherwise true)'
Also "--dev" option description needs to be clarified...

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