How can I lazy load remoteEntry.js
See original GitHub issueI see remote app start loading after all the remoteEntry.js loaded if i put all the remotes to host’s webpack config.
And in angular11-microfrontends, there is a method named loadRemoteEntry
to load remoteEntry.js when I need it. But I should add the method to my project.
Is there any original webpack config to enable lazy load remoteEntry.js when I import the remote app? Just like this:
new ModuleFederationPlugin({
remotes: {
"microfeeg-app-child1": {
url: "microfeeg_app_child1@/microfeeg-app-child1/remoteEntry.js",
lazy: true,
}
},
}),
Thanks for replay.😁
Issue Analytics
- State:
- Created 3 years ago
- Reactions:13
- Comments:30 (11 by maintainers)
Top Results From Across the Web
Webpack module federation lazy loading remoteEntry.js
When I enter page there are many requests for remoteEntry.js files for each app I have. I do not want to fetch it...
Read more >Module Federation - webpack
Remote modules are modules that are not part of the current build but are loaded at runtime from a remote container. Loading remote...
Read more >Webpack Module Federation (lazy load) - StackBlitz
Run the following commands in the root. directory. ```bash. npm i. npm run start. ``` Both `apps/root` and `apps/app2` are. independently deployed apps:....
Read more >use-lazy-module-federation - NPM Package Overview - Socket
Start using Socket to analyze use-lazy-module-federation and its 0 ... This project was inspire from this sample to load dynamic remote ...
Read more >Setting up remote components and services with webpack ...
<script src="http://localhost:3000/remote/remoteEntry.js"></script ... In above example we loaded remoteService synchronously in host application.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
How are the promises? Which plugin? I just indicate the path to the remoteEntry.js in the webpack module federation and that’s it. How to access the behavior of the plugin?
Upon looking into the webpack core code. Webpack will try/want to initialize all remotes known to it upfront. If you want to prevent that. You can create a proxy trap with promise new promise, basically resolve nothing and perform init manually when get() is fired.