How to use Module Federation in nodejs?
See original GitHub issueModule Federation is only for Angular applications? Can i use it in pure nodejs application?
I mean I want to create a host application (nodejs, api-gateway) that can lazy load the libs i choose using my config file. something like so possible?
// config.json:
{ fn: 'dist/libs/lib-api' }
-----
// app/api-gateway:
const lib = readFromConfig();
import(lib).then(m => {
express().use(m.routes).listen(3000);
});
And each lib will be consumed by the host application just like Module Federation works.
Is it possible to do with nx?
Issue Analytics
- State:
- Created a year ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
How I implemented Module Federation for Node.js and did ...
NodeModuleFederation is a wrapper around webpack's ModuleFederation plugin and provides Node.js specific remote dependency resolution rules. It ...
Read more >@module-federation/node - npm
Start using @module-federation/node in your project by running `npm i @module-federation/node`. There is 1 other project in the npm registry ...
Read more >Module Federation - webpack
A container is created through a container entry, which exposes asynchronous access to the specific modules. The exposed access is separated into two...
Read more >GitHub - module-federation/node
A package to bring the concept and power of module federation to NodeJS. ⚡ Features. Exposes two Webpack Plugins to enable Module Federation....
Read more >node.js - Use Module Federation in a non frontend application
in the webpack.config of the ModuleA project i have exposed the module using the "Module Federation" feature of webpack 5. I want to...
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
Thanks, we already have a working POC and a plan of implementation that we’re working through
@sir-captainmorgan21 We’re still planning out the work, but it’ll mostly be done by the Nx Core Team. You can follow along with PRs etc that get pushed 😃