You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I got the task to enable some sort of Microfrontend handling within our Company, we already decided to go with Module Federation wich I really enjoy so far (came from an SystemJs Project). But putting this into an larger Scale is a bit challenging.
First of my goal is to manipulate the loaded Remotes for an Application based on the envirounment where I plan to inject the respective Remotes. I tried to implement it as an plugin wich roughly hooks into the beforeInit hook. This worked already well and I'm able to inject our corporate remotes correctly.
But how it is possible to access any build time Variables within the Plugin. I tried in an modern js bootstrap to access certain variables I setup with source.define and source.define but since this only leads to Code replacement it is not possible to truly put this into runtime. As I would suggest since the plugin lives in the .node_modules/.federation custom compilation wich does not replace that accordingly.
So my question is: Are I'm on the right track to configure such a thing with an module federation plugin or should I target an modern / rspack plugin to inject the module federation accordingly. Or are there better approaches for that ?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi,
I got the task to enable some sort of Microfrontend handling within our Company, we already decided to go with Module Federation wich I really enjoy so far (came from an SystemJs Project). But putting this into an larger Scale is a bit challenging.
First of my goal is to manipulate the loaded Remotes for an Application based on the envirounment where I plan to inject the respective Remotes. I tried to implement it as an plugin wich roughly hooks into the
beforeInit
hook. This worked already well and I'm able to inject our corporate remotes correctly.But how it is possible to access any build time Variables within the Plugin. I tried in an modern js bootstrap to access certain variables I setup with source.define and source.define but since this only leads to Code replacement it is not possible to truly put this into runtime. As I would suggest since the plugin lives in the
.node_modules/.federation
custom compilation wich does not replace that accordingly.So my question is: Are I'm on the right track to configure such a thing with an module federation plugin or should I target an modern / rspack plugin to inject the module federation accordingly. Or are there better approaches for that ?
Greetings
Beta Was this translation helpful? Give feedback.
All reactions