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

fix: set mode=production by default #1688

Merged
merged 2 commits into from
Jul 17, 2020
Merged

fix: set mode=production by default #1688

merged 2 commits into from
Jul 17, 2020

Conversation

snitin315
Copy link
Member

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

@snitin315 snitin315 requested a review from a team as a code owner July 17, 2020 10:33
@@ -201,7 +201,7 @@ module.exports = {
alias: 'p',
usage: '--prod',
type: Boolean,
defaultValue: undefined,
defaultValue: false,
Copy link
Member

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

Copy link
Member Author

@snitin315 snitin315 Jul 17, 2020

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

Copy link
Member

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

Copy link
Member Author

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)

@webpack-bot
Copy link

@snitin315 Thanks for your update.

I labeled the Pull Request so reviewers will review it again.

@rishabh3112 Please review the new changes.

@snitin315 snitin315 merged commit 8360df7 into next Jul 17, 2020
@snitin315 snitin315 deleted the fix/default-mode branch July 17, 2020 12:10
pezholio added a commit to dxw/playbook that referenced this pull request Oct 20, 2020
The `-p` flag has been removed in Webpack 4.x. See webpack/webpack-cli#1688
pezholio added a commit to dxw/playbook that referenced this pull request Oct 20, 2020
The `-p` flag has been removed in Webpack 4.x. See webpack/webpack-cli#1688
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Webpack default mode not set to production
4 participants