发布

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

    frostbyte_neo 发布于 2025-08-01 17:22:58 +00:00

    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)

    https://github.com/nrwl/nx/issues/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.


    Co-authored-by: Colum Ferry cferry09@gmail.com

    下载附件