Skip to content

fix(module-federation): re-add support for mf aliases #31347

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ryok90
Copy link

@ryok90 ryok90 commented May 26, 2025

Current Behavior

At some point in time, we had support for Module Federation aliases, and I noticed some of our examples broke in the latest versions of Nx.

image

This is an attempt to regain that support with some normalization of Module Federation project names.

Expected Behavior

We need to have the mapping back of aliases in the format:

const mfConfig = {
  // ...
  "@nx-mf/remote": "_nx_mf_remote@http://localhost:3001",
  // ...
}

Related Issue(s)

#31346

Fixes #
Add a function specific to parse Federated names into resolvable JavaScript vars.
Use this function in every place a str.replace(/-/, '_') is being used.

@ryok90 ryok90 requested review from FrozenPandaz, isaacplmann and a team as code owners May 26, 2025 21:21
@ryok90 ryok90 requested a review from ndcunningham May 26, 2025 21:21
Copy link

vercel bot commented May 26, 2025

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

1 Skipped Deployment
Name Status Preview Updated (UTC)
nx-dev ⬜️ Ignored (Inspect) Visit Preview May 26, 2025 9:23pm

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

Successfully merging this pull request may close these issues.

1 participant