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

Webpack5: Apply named exports order logic for stories only #18284

Merged
merged 1 commit into from
May 20, 2022

Conversation

shilman
Copy link
Member

@shilman shilman commented May 20, 2022

Issue: #17914 #17587 #18263

What I did

Webpack5 does not preserve the order named exports. I created a babel plugin which inserts a special magic named export __namedExportsOrder to preserve this order. Unfortunately, this is being applied to all files in the project and can interfere with other tools that need this order.

This PR fixes it with:

  • Fix logic where incoming babel config can be undefined
  • Scope the named exports plugin to only apply to story files

How to test

I'm not sure! I tested this by hand editing node_modules in a sample project 😭 and looking at the raw source in the browser dev tools...

@shilman shilman added bug patch:yes Bugfix & documentation PR that need to be picked to main branch builder-webpack5 labels May 20, 2022
@nx-cloud
Copy link

nx-cloud bot commented May 20, 2022

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 89dc4f1. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch


✅ Successfully ran 1 target

Sent with 💌 from NxCloud.

@shilman shilman added this to the 6.5 stabilization milestone May 20, 2022
Copy link
Member

@yannbf yannbf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug builder-webpack5 patch:done Patch/release PRs already cherry-picked to main/release branch patch:yes Bugfix & documentation PR that need to be picked to main branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants