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

fix(webpack): update withNx mainFields ordering to support tree-shaking #17599

Merged
merged 2 commits into from
Jun 22, 2023

Conversation

jeremiah-snee-openx
Copy link
Contributor

@jeremiah-snee-openx jeremiah-snee-openx commented Jun 14, 2023

fix(webpack): with-nx default webpack resolve mainFields order breaking tree-shaking


Current Behavior

Default webpack config
mainFields: [ 'browser', 'main', 'module', ]

Broken Tree-shake.
@mui/icons-material in library package fully included in vendor bundle.

Expected Behavior

Default webpack config
mainFields: [ 'browser', 'module', 'main' ]

Related Issue(s)

Closes #9717
Closes #3069

Fixes #
Reorder default resolve.mainFields

@jeremiah-snee-openx jeremiah-snee-openx requested a review from a team as a code owner June 14, 2023 16:27
@vercel
Copy link

vercel bot commented Jun 14, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
nx-dev ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 14, 2023 4:51pm

@AgentEnder AgentEnder changed the title fix(with-nx): with-nx default webpack resolve mainFields order breaking tree-shaking fix(webpack): with-nx default webpack resolve mainFields order breaking tree-shaking Jun 14, 2023
@AgentEnder AgentEnder requested review from jaysoo and removed request for AgentEnder June 21, 2023 21:08
@jaysoo jaysoo changed the title fix(webpack): with-nx default webpack resolve mainFields order breaking tree-shaking fix(webpack): update withNx mainFields ordering to support tree-shaking Jun 22, 2023
@github-actions
Copy link

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 28, 2023
@jeremiah-snee-openx jeremiah-snee-openx deleted the patch-1 branch March 21, 2024 02:56
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Production build tree shaking not working Tree shaking problem (React Application and Library)
2 participants