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

feat(webpack-cli): added mode argument #1253

Merged
merged 1 commit into from
Feb 23, 2020

Conversation

ematipico
Copy link
Contributor

What kind of change does this PR introduce?

Feature, it adds back mode argument

Did you add tests for your changes?
Yes

If relevant, did you update the documentation?
Yes

Summary
People asked to have back the mode argument.

Does this PR introduce a breaking change?

No

Other information

@webpack-bot
Copy link

Thank you for your pull request! The most important CI builds succeeded, we’ll review the pull request soon.

Copy link
Member

@anshumanv anshumanv left a comment

Choose a reason for hiding this comment

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

Some suggestions, PTAL

const { stat } = require('fs');
const { resolve } = require('path');
describe('mode flags', () => {
it('should load a development config when --prod is passed', done => {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
it('should load a development config when --prod is passed', done => {
it('should load a production config when --prod is passed', done => {

Copy link
Member

Choose a reason for hiding this comment

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

Similarly in all tests below

});

it('should load a development config when --mode=production is passed', done => {
const { stderr, stdout } = run(__dirname, ['--prod', 'production']);
Copy link
Member

Choose a reason for hiding this comment

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

Did you mean?

Suggested change
const { stderr, stdout } = run(__dirname, ['--prod', 'production']);
const { stderr, stdout } = run(__dirname, ['--mode', 'production']);

expect(stats.isFile()).toBe(true);
done();
});
});
Copy link
Member

Choose a reason for hiding this comment

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

You can add another case of using both --prod and --dev which should use prod config.

@webpack-bot
Copy link

@ematipico Thanks for your update.

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

@anshumanv Please review the new changes.

@ematipico
Copy link
Contributor Author

@anshumanv thank you for your inputs! PR updated :)

Copy link
Member

@anshumanv anshumanv left a comment

Choose a reason for hiding this comment

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

Looks good!

Copy link
Member

@rishabh3112 rishabh3112 left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@rishabh3112 rishabh3112 merged commit 7a5b33d into webpack:next Feb 23, 2020
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