-
-
Notifications
You must be signed in to change notification settings - Fork 605
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: improve parsing of --env
flag
#3286
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.
Let's add test case --foo=undefined
, in this case we should have undefined
string value
Codecov Report
@@ Coverage Diff @@
## master #3286 +/- ##
=======================================
Coverage 92.08% 92.09%
=======================================
Files 23 23
Lines 1731 1733 +2
Branches 519 519
=======================================
+ Hits 1594 1596 +2
Misses 137 137
Continue to review full report at Codecov.
|
// Should generate the appropriate files | ||
expect(existsSync(resolve(__dirname, "./dist/undefined-foo.js"))).toBeTruthy(); | ||
}); | ||
} |
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.
And lets add
webpack --env TEST=""
webpack --env TEST=\\\"\\\"
To avoid future regressions
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.
@alexander-akait Done ✅
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.
Looks good, left a suggestion.
test/build/config/type/function-with-env/function-with-env.test.js
Outdated
Show resolved
Hide resolved
Co-authored-by: Rishabh Chawla <rishabh31121999@gmail.com>
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.
lgtm
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.
Looks good, we need a patch release after merge
What kind of change does this PR introduce?
bugfix.
Did you add tests for your changes?
Yes
If relevant, did you update the documentation?
I will add a note on webpack.js.org
Summary
Fix #3284
Set the variable to
undefined
instead of setting it totrue
.Does this PR introduce a breaking change?
No
Other information
No