-
-
Notifications
You must be signed in to change notification settings - Fork 597
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: supply argv to config with functions #1721
Conversation
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.
Good job!
@anshumanv Thanks for your update. I labeled the Pull Request so reviewers will review it again. @evilebottnawi Please review the new changes. |
I think this does not actually work - while it seems like the arguments now can be passed to config function, when you actually tries to pass custom arguments, user will stuck at "Which flags do you want to use", likely as the custom argument is unknown to the cli. |
@milizhang can you give example? |
@anshumanv Please take a look at this: https://github.com/milizhang/webpack-cli-4-argv-repro If you use webpack-cli 3, |
Yep unknown arguments are not registered, you should use |
Is this something that webpack-cli explicitly decided to deprecate in V4? Are there anyway to register custom arguments in configurations? |
Yes, passing arbitrary values was deprecated. You should be able to achieve it using You can just do -
env = { testArg: 'test' } // in config |
Got it. Picking custom argv over env was more of a preference issue. Since it is deprecated I will move toward env. Thanks for the info. |
What kind of change does this PR introduce?
fix
Did you add tests for your changes?
Yes
If relevant, did you update the documentation?
NA
Summary
Does this PR introduce a breaking change?
No
Other information
Fixes #1704
Fixes #1126