Skip to content

[Bug]: NormalModuleReplacementPlugin cannot work together with ModuleFederationPlugin shared #11437

@SoonIter

Description

@SoonIter

System Info

Rspack v1.4.11

Details

Before

rspack.NormalModuleReplacementPlugin work

  pluginModuleFederation({
      name: 'federation_consumer',
      remotes: {
        remote1: 'remote1@http://localhost:2001/mf-manifest.json',
      },
      shared: ['react', 'react-dom'],
    }),
Image

After

rspack.NormalModuleReplacementPlugin not work

  pluginModuleFederation({
      name: 'federation_consumer',
      remotes: {
        remote1: 'remote1@http://localhost:2001/mf-manifest.json',
      },
      shared: ['react', 'react-dom', '@arco-design/web-react'],
    }),
Image

Reproduce link

https://github.com/SoonIter/rsbuild-mf-normalModuleReplace-issue.git

Reproduce Steps

  1. pnpm install
  2. pnpm run build

Metadata

Metadata

Assignees

Labels

teamThe issue/pr is created by the member of Rspack.

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions