-
-
Notifications
You must be signed in to change notification settings - Fork 620
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
fix: set mode=production by default #1688
Conversation
@@ -201,7 +201,7 @@ module.exports = { | |||
alias: 'p', | |||
usage: '--prod', | |||
type: Boolean, | |||
defaultValue: undefined, | |||
defaultValue: false, |
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.
I've always wondered why we have flags --dev
/--prod
, we already have --mode
, it can be misleading for new developers and some of them will be write webpack --prod --mode=production
, but it is wrong
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.
I've always wondered why we have flags --dev/--prod, we already have --mode, it can be misleading for new developers and some of them will be write webpack --prod --mode=production, but it is wrong
It's just alias for --mode=development or production
like we have --verbose
for --stats=verbose
.
CLI throws a warning if user do something like webpack --prod --mode=production
You provided both 'mode' and --prod arguments. You should provide just one. "mode" will be used
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.
I think we should remove them in the future, but it is not high priority
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.
/cc @webpack/cli-team anyone in favor of --dev
and --prod
.?
Not a big deal but even if I understand the point of having clean and concise --dev and --prod options, I think the --mode= option better matches the way it works in configuration file and is more straightforward when you already know configuration file. Just my 2 cents, but I'm not sure a breaking change in this area is really useful ?
from feedback too #1222 (comment)
83cf618
to
0ca97e7
Compare
@snitin315 Thanks for your update. I labeled the Pull Request so reviewers will review it again. @rishabh3112 Please review the new changes. |
The `-p` flag has been removed in Webpack 4.x. See webpack/webpack-cli#1688
The `-p` flag has been removed in Webpack 4.x. See webpack/webpack-cli#1688
What kind of change does this PR introduce?
bugfix
Did you add tests for your changes?
yes
If relevant, did you update the documentation?
NA
Summary
Resolve #1678
Does this PR introduce a breaking change?
no
Other information