-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
Conversation
@@ -85,7 +85,7 @@ function buildBundle( | |||
entryFile: args.entryFile, | |||
sourceMapUrl, | |||
dev: args.dev, | |||
minify: !args.dev, | |||
minify: args.minify != null ? args.minify : !args.dev, |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
If specified, this flag will override the `--dev` flag. Otherwise, the existing behavior remains the default.
I'm not sure why the CircileCI tests are failing - it doesn't appear to be related to anything in this change. Somehow, one of the tests can't create an Android VM, so it fails to even get off the ground. |
@@ -25,6 +25,10 @@ module.exports = [ | |||
parse: (val) => val === 'false' ? false : true, | |||
default: true, | |||
}, { | |||
command: '--minify [boolean]', | |||
description: 'Enables or disables minification, overriding "--dev"', |
There was a problem hiding this comment.
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...
@swansontec I tried to find reviewers for this pull request and wanted to ping them to take another look. However, based on the blame information for the files in this pull request I couldn't find any reviewers. This sometimes happens when the files in the pull request are new or don't exist on master anymore. Is this pull request still relevant? If yes could you please rebase? In case you know who has context on this code feel free to mention them in a comment (one person is fine). Thanks for reading and hope you will continue contributing to the project. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. If you think this issue should definitely remain open, please let us know why. Thank you for your contributions. |
If specified, this flag will override the
--dev
flag. Otherwise, the existing behavior remains the same.Motivation
Some of our upstream dependencies break under minification. Therefore, we need to produce release builds with minification turned off. Adding this flag allows us to manually create builds with the configuration
--dev false --minify false
, which was previously impossible from the CLI.Test Plan
In a fresh react-native project, just run these commands:
If you check the output, you will see:
Release Notes
[CLI] [FEATURE] [local-cli/bundle] - Added a
--minify
option to thebundle
command