You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The idea is, when process.env.NODE_ENV is 'production', the React component displayName and propTypes should be dead-code eliminated from the bundle. This works with webpack but not esbuild.
Thanks for the report. I have a substitution rule for false && anything → false but it looks like I also need a rule for noSideEffects && false → falsy.
With this code in
in.js
:And this use of the CLI:
abcde
correctly does not appear in theout.js
bundle.But, unexpectedly, it does with this:
In real world modules, I have code like this:
The idea is, when
process.env.NODE_ENV
is'production'
, the React componentdisplayName
andpropTypes
should be dead-code eliminated from the bundle. This works with webpack but not esbuild.With this CLI usage:
The
process.env.NODE_ENV !== 'production'
is swapped withfalse
in theout.js
bundle, but the dead code is not eliminated.The text was updated successfully, but these errors were encountered: