Fetching remoteEntry.js file from a remote source on the server
See original GitHub issueHey everyone,
First of all thanks a lot for the amazing work on module federation. I was wondering if it is possible to fetch the remoteEntry.js
file from a remote source on the server. I know for client this is possible and was wondering if the same was possible on the server instead of fetching from the filesystem.
Issue Analytics
- State:
- Created 3 years ago
- Comments:16 (7 by maintainers)
Top Results From Across the Web
remoteEntry.js was not being fetched despite being defined?
js from subA and subB are being fetched by host, despite I did not import any source code from subB , the behaviour...
Read more >Tutorial - A Guide to Module Federation for Enterprise
Fetch configuration files and assign them to global variables to be used ... Note: remoteEntry.js is considered a local chunk in the remote...
Read more >Module Federation - webpack
This object is used as a shared scope in the remote container and is filled with the provided modules from a host. It...
Read more >Setting up remote components and services with webpack ...
Setting up Federated remote application. Install webpack 5 in your application. npm i -D webpack webpack-cli webpack-dev-server. 2.
Read more >Micro-frontends: Module Federation with WebPack 5
We also need to specify the remoteEntry.js file from the remote host: <!-- public/index.html (fragment)--> ... < ...
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
It’s possible. You can do it in this way:
Logic with
require('vm')
taken from webpackasync-node
target. Note thatsomeFetchFunction
should be defined somewhere in user-land code.But it doesn’t solve the problem at all because you will need a way to fetch remote chunks via HTTP. To do this you have 2 ways:
@7rulnik pretty much nailed what the http chunk loading plugin does. There are some other changes needed in the webpack chunk loading runtime that’s embeded into the remote entry otherwise it will try to load chunks from local disk instead of over the network.