question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to use Module Federation in nodejs?

See original GitHub issue

Module 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:open
  • Created a year ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Coly010commented, Nov 9, 2022

Thanks, we already have a working POC and a plan of implementation that we’re working through

1reaction
Coly010commented, Oct 31, 2022

@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 😃

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found