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: mode behaviour #1824

Merged
merged 3 commits into from Sep 24, 2020
Merged

fix: mode behaviour #1824

merged 3 commits into from Sep 24, 2020

Conversation

anshumanv
Copy link
Member

What kind of change does this PR introduce?

fix

Did you add tests for your changes?
Yes

If relevant, did you update the documentation?
Yes

Summary
Fix mode priority

  • mode form flag
  • config
  • NODE_ENV

Does this PR introduce a breaking change?
Nay

Other information

finalMode = NODE_ENV;
} else {
finalMode = mode || PRODUCTION;
finalMode = PRODUCTION;
Copy link
Member

Choose a reason for hiding this comment

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

No need this, webpack do it itself (default is production)

Copy link
Member Author

Choose a reason for hiding this comment

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

gotcha

Copy link
Member Author

Choose a reason for hiding this comment

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

Need this because #1678 hence added

Copy link
Member

Choose a reason for hiding this comment

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

Okay, let's refactor it in future

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure sure

Copy link
Member

@alexander-akait alexander-akait left a comment

Choose a reason for hiding this comment

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

Also can you add multicompiler tests

@anshumanv
Copy link
Member Author

Also can you add multicompiler tests

-c 1.js -c 2.js

which config mode should be priority? @evilebottnawi

@alexander-akait
Copy link
Member

With --mode=production both configurations should set mode: production, without --mode=production but with mode: 'production' in config should keep values, with NODE_ENV and without mode: 'production' should use NODE_ENV, same logic, maybe better to use module: development to test, because default value is production

@anshumanv
Copy link
Member Author

With --mode=production both configurations should set mode: production, without --mode=production but with mode: 'production' in config should keep values, with NODE_ENV and without mode: 'production' should use NODE_ENV, same logic, maybe better to use module: development to test, because default value is production

Needed more work than I thought, looks good now

@webpack-bot
Copy link

@anshumanv Thanks for your update.

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

@evilebottnawi Please review the new changes.

@rishabh3112 rishabh3112 merged commit 9e9c70b into webpack:next Sep 24, 2020
@anshumanv anshumanv deleted the fix/mode branch September 24, 2020 12:02
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.

None yet

4 participants