Open foxylion opened 6 days ago
I tried configuring the shared section of the module federation configuration, but some changes are not being reflected in the mf-manifest.json file.
shared
mf-manifest.json
Steps to Reproduce:
rsbuild/module-federation-enhanced/consumer
shared: { react: { singleton: false, requiredVersion: '^18.0.0' }, 'react-dom': { singleton: false, requiredVersion: '^18.0.0' }, }
"shared": [ { "id": "federation_consumer:react-dom", "name": "react-dom", "version": "18.2.0", "singleton": true, "requiredVersion": "^18.2.0", "assets": { "js": { "async": [ "static/js/async/vendors-node_modules_pnpm_react_18_2_0_node_modules_react_index_js.js" ], "sync": [ "static/js/async/vendors-node_modules_pnpm_react-dom_18_2_0_react_18_2_0_node_modules_react-dom_index_js.js" ] }, "css": { "async": [], "sync": [] } } }, { "id": "federation_consumer:react", "name": "react", "version": "18.2.0", "singleton": true, "requiredVersion": "^18.2.0", "assets": { "js": { "async": [], "sync": [ "static/js/async/vendors-node_modules_pnpm_react_18_2_0_node_modules_react_index_js.js" ] }, "css": { "async": [], "sync": [] } } } ]
The mf-manifest.json file reflects the singleton setting as true, despite my configuration setting it to false. Additionally, the requiredVersion specified in my configuration (^18.0.0) seems to be overridden by default values.
singleton
true
false
requiredVersion
^18.0.0
https://github.com/foxylion/rspack-examples/tree/repro/share-config-not-in-mf-manifest-json (Diff)
pnpm
System: OS: Linux 6.8 Ubuntu 24.04.1 LTS 24.04.1 LTS (Noble Numbat) CPU: (20) x64 12th Gen Intel(R) Core(TM) i7-12700H Memory: 4.60 GB / 31.02 GB Container: Yes Shell: 5.9 - /bin/zsh Binaries: Node: 20.18.0 - ~/.nvm/versions/node/v20.18.0/bin/node npm: 10.8.2 - ~/.nvm/versions/node/v20.18.0/bin/npm pnpm: 9.12.1 - ~/.local/share/pnpm/pnpm Browsers: Chrome: 129.0.6668.100
@ScriptedAlchemy do you have any thoughts on that? Is this possibly another Rsbuild related problem?
@2heal1 can you cake a look at this?
Describe the bug
I tried configuring the
shared
section of the module federation configuration, but some changes are not being reflected in themf-manifest.json
file.Steps to Reproduce:
rsbuild/module-federation-enhanced/consumer
, the configuration includes the following:mf-manifest.json
file at http://localhost:2000/mf-manifest.json, the shared block in the manifest contains the following:The
mf-manifest.json
file reflects thesingleton
setting astrue
, despite my configuration setting it tofalse
. Additionally, therequiredVersion
specified in my configuration (^18.0.0
) seems to be overridden by default values.Reproduction
https://github.com/foxylion/rspack-examples/tree/repro/share-config-not-in-mf-manifest-json (Diff)
Used Package Manager
pnpm
System Info
Validations