Skip to content
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

Exported object names not minified since 5.79 #18013

Closed
alexander-akait opened this issue Jan 26, 2024 Discussed in #17988 · 2 comments · Fixed by #18059
Closed

Exported object names not minified since 5.79 #18013

alexander-akait opened this issue Jan 26, 2024 Discussed in #17988 · 2 comments · Fixed by #18059
Labels

Comments

@alexander-akait
Copy link
Member

Discussed in #17988

Originally posted by vjhebbar January 21, 2024
Hello,

Since I updated to webpack 5.79+ in my project, bundle sizes have increased because some exported object names are not minified.

It turns out that this is due to those objects being destructured in modules where they are imported.
Refactoring the code to remove the object destructuring minimizes the name again.

Prior to 5.79, the names were minified regardless of the use of destructuring.

Is this behavior aligned with #16941?

If this is not expected behavior, I'll share my configs and minimum reproducible code.

Looking forward to your thoughts and suggestions.

The latest version where the issue is reproducible is 5.90.

@alexander-akait
Copy link
Member Author

@vjhebbar
Copy link

vjhebbar commented Jan 27, 2024

The root cause is that canMangle is set to false in lib/dependencies/HarmonyImportDependencyParserPlugin.js.
Should this flag be set according to the mangleExports optimization value?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants