Replies: 4 comments 2 replies
-
For anyone interested, I asked the same question on StackOverflow. And there are some answers (also they are mainly guesses, but still, can be helpful enough) |
Beta Was this translation helpful? Give feedback.
-
this seems to be a bug to me. actually, if you debug the |
Beta Was this translation helpful? Give feedback.
-
I'm confused with the filename: "remoteEntry.js",
exposes:{ xxx. }
shared: {
react: {
eager: true,
requiredVersion: "^18.2.0",
}, here then how would a host override react?? what's the purpose of the eager option? I know how it behaves, but I don't know the use case of it |
Beta Was this translation helpful? Give feedback.
-
The author of Webpack Module Federation had explained it very clearly in this video regarding why the bootstrap file. |
Beta Was this translation helpful? Give feedback.
-
I was looking into Webpack 5 Module federation feature, and have some trouble understanding why my code does not work. The idea is pretty similar to what standard module federation examples do:
app1
- is the host appapp2
- is a remote exposing the whole app toapp1
(
app1
renders the header and horizontal line, below which theapp2
should be rendered)Both
app1
andapp2
declaresreact
andreact-dom
as their shared, singleton, eager dependencies in theweback.config.js
:In the App1 index.js I have next code:
The App1
App.js
component is next:But when I start the application I get the next error:
If I extract everything from
index.js
tobootstrap.js
and inindex.js
will doEverything works just fine.
This confuses me as official docs and blog posts from the creator states that you can do either
bootstrap.js
way OR declare dependency as an eager one.Would appreciate any help/insights on why it does not work without
bootstrap.js
pattern.Here is a link to full GitHub sandbox I was building: https://github.com/vovkvlad/webpack-module-fedaration-sandbox/tree/master/simple
Beta Was this translation helpful? Give feedback.
All reactions