-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Ignore noop dependencies #1166
Ignore noop dependencies #1166
Conversation
What about things that evaluate to false but aren't exactly false. e.g. |
Isn't that equivalent to this code ( if('') {
require('if-falsy-optional-dep');
} |
@devongovett sounds good, would this only apply to @mischnic I'm not sure to understand |
I was referring to @devongovett 's comment. The replacement is already done here: parcel/src/visitors/globals.js Lines 21 to 31 in 6c3d34f
|
@mischnic Oh, gotcha. The replacement is done before Lines 90 to 109 in 3435c4c
|
Hi @fathyb, will there be any progress with this issue? Thank you. |
Prior to collecting dependencies
862f511
to
d02125f
Compare
4266043
to
f96cc11
Compare
Updated to move environment variable inlining to a separate stage prior to dependency collection, and now evaluate the if statement test to determine whether it is true or false rather than only supporting literals. |
Ignore dependencies in a falsy branch, example
if(false)
orif('')
.This is needed when consuming Webpack generated UMD modules. For example in
react-data-grid
:Triggers this error :
Reported by
Jindřich Pergler