Skip to content

feat: support multiple env params#1715

Merged
anshumanv merged 6 commits intowebpack:nextfrom
anshumanv:multiple-env
Aug 1, 2020
Merged

feat: support multiple env params#1715
anshumanv merged 6 commits intowebpack:nextfrom
anshumanv:multiple-env

Conversation

@anshumanv
Copy link
Copy Markdown
Member

What kind of change does this PR introduce?

feat

Did you add tests for your changes?
Yes

If relevant, did you update the documentation?
Yes

Summary
Having multiple env is a common use case so a single arg won't suffice, hence added support for multiple

Does this PR introduce a breaking change?
No

Other information

Copy link
Copy Markdown
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.

Can we add tests?

@anshumanv
Copy link
Copy Markdown
Member Author

in near future

@webpack-bot
Copy link
Copy Markdown

@anshumanv Thanks for your update.

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

@evilebottnawi Please review the new changes.

@@ -1 +1,3 @@
console.log('chuntaro');
// eslint-disable-next-line no-undef
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

need disable because envMessage is not present in scope but instead coming from env

entry: './a.js',
mode: 'development',
stats: env.verboseStats ? 'verbose' : 'normal',
plugins: [new DefinePlugin({ envMessage: env.envMessage ? JSON.stringify('env message present') : false })],
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

need JSON.stringify, can't pass string directly 😞

@anshumanv anshumanv merged commit d315443 into webpack:next Aug 1, 2020
@anshumanv anshumanv deleted the multiple-env branch August 1, 2020 11:59
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.

4 participants