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
In webpack module federation it is possible to import components at runtime.
functionloadComponent(scope,module){returnasync()=>{// Initializes the share scope. This fills it with known provided modules from this build and all remotesawait__webpack_init_sharing__('default');constcontainer=window[scope];// or get the container somewhere else// Initialize the container, it may provide shared modulesawaitcontainer.init(__webpack_share_scopes__.default);constfactory=awaitwindow[scope].get(module);constModule=factory();returnModule;};}
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
Uh oh!
There was an error while loading. Please reload this page.
-
In webpack module federation it is possible to import components at runtime.
https://github.com/module-federation/module-federation-examples/blob/master/advanced-api/dynamic-remotes/app1/src/App.js
Is this project also possible? Is there any example?
Beta Was this translation helpful? Give feedback.
All reactions