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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: destructing assignment of dynamic import json file #17418

Merged
merged 2 commits into from Dec 29, 2023

Conversation

ahabhgk
Copy link
Contributor

@ahabhgk ahabhgk commented Jun 23, 2023

fix #17042

Summary

馃 Generated by Copilot at 182f913

Fixed a tree-shaking bug for default exports of JSON modules and added new test cases for dynamic imports with webpackExports hint. The test cases cover various scenarios of importing JSON modules and other modules with destructuring assignment and named imports.

Details

馃 Generated by Copilot at 182f913

  • Fix a bug where the default export of non-tree-shakable modules was incorrectly tree-shaken when using destructuring assignment or named imports (link)
  • Add new test cases to test/cases/chunks/destructuring-assignment and test/cases/chunks/inline-options to cover the bug fix and the webpackExports hint for JSON modules and modules with exportsType: "default" (link, link, link, link, link, link, link, link, link, link, link)

@webpack-bot
Copy link
Contributor

For maintainers only:

  • This needs to be documented (issue in webpack/webpack.js.org will be filed when merged)
  • This needs to be backported to webpack 4 (issue will be created when merged)

@alexander-akait alexander-akait merged commit 4d9152b into webpack:main Dec 29, 2023
49 of 51 checks passed
@alexander-akait
Copy link
Member

Thank you

@ahabhgk ahabhgk deleted the fix-17042 branch December 30, 2023 06:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Shipped
Development

Successfully merging this pull request may close these issues.

Destructuring assignment of dynamically imported JSON files broken in 5.80.0
3 participants