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
Some optimizing compilers such as the Google Closure Compiler ADVANCED mode and Terser with keep_quoted enabled have a problem with this rewrite. They use the quote notation as a way to say, "hands off" when it comes to minifying variable names so that external interfaces can be preserved. This leads to it seeing x["somevar"] and x.somevar as two different properties, such that x.somevar is minified and x["somevar"] is converted to x.somevar (shorter by one char but not minified). See the Closure docs.
What is the expected behavior?
The expression after the imported object (obj1 in this case) should remain untouched. That is,
Feature request
Similar to Issue #17218, chained calls off of commonjs imports are completely rewritten by webpack.
e.g.,
generates
Some optimizing compilers such as the Google Closure Compiler ADVANCED mode and Terser with keep_quoted enabled have a problem with this rewrite. They use the quote notation as a way to say, "hands off" when it comes to minifying variable names so that external interfaces can be preserved. This leads to it seeing
x["somevar"]
andx.somevar
as two different properties, such thatx.somevar
is minified andx["somevar"]
is converted tox.somevar
(shorter by one char but not minified). See the Closure docs.What is the expected behavior?
The expression after the imported object (obj1 in this case) should remain untouched. That is,
What is motivation or use case for adding/changing the behavior?
Get webpack 5 to generate output compatible with the Google Closure Compiler.
How should this be implemented in your opinion?
Factor the code made in #17203
HarmonyImportSpecifierDependency.js
into a shared location and call it fromCommonJsFullRequireDependency.js
as well.Are you willing to work on this yourself?
Yes. See PR #17718.
The text was updated successfully, but these errors were encountered: