Skip to main content

Module Federation Status

Current state: Module Federation is turned off in every app. All five apps build as plain, independent React single-page apps (SPAs). There are no hosts and no remotes at runtime.

This page describes exactly how things stand today so the rest of the docs are not misread. It does not predict whether Module Federation will be turned back on.

This corrects older docs

Some earlier architecture pages describe Module Federation as an active part of the system. That is not accurate for the current code. Where those pages and this page disagree, this page is correct.


What you would expect vs. what is true

The project was originally built around Module Federation, and the traces are everywhere:

  • The workspace is named AquagenMfWebapp and the library import scope is @aquagen-mf-webapp/… ("mf" = Module Federation).
  • The dependencies @module-federation/enhanced and @nx/module-federation are installed.
  • Each app has a module-federation.config.js file.
  • src/main.jsx in every app is import('./bootstrap') — the async boundary Module Federation needs.

Despite all of that, no federation actually happens. The naming and scaffolding are historical.


How it is turned off

1. The plugin is commented out in the config Nx actually uses

Nx builds each app using the conventionally-named rspack.config.js. In every app, the Module Federation plugin is commented out, with a literal marker:

// apps/production/rspack.config.js
// Comment out module federation temporarily
// const { NxModuleFederationPlugin, NxModuleFederationDevServerPlugin } = require('@nx/module-federation/rspack');
...
// new NxModuleFederationPlugin({ config }, { dts: false }),
// new NxModuleFederationDevServerPlugin({ config }),

So the build produces a normal SPA bundle with no federation runtime.

2. The config that has it enabled is never used

Each app also has a second file, rspack.config.prod.js, where the Module Federation plugin is uncommented. But:

  • Nx only reads rspack.config.js, never rspack.config.prod.js.
  • A repo-wide search for rspack.config.prod returns zero references — no script, no project.json, nothing points at it.

So rspack.config.prod.js is dead config. See Legacy & Deprecated.

3. Even if it ran, there are no remotes

Every module-federation.config.js declares the app as a host with an empty remotes list:

module.exports = {
name: 'production',
remotes: [],
};

A host with no remotes federates nothing.


So what makes an app "standalone"?

Because Module Federation is off, "standalone" has nothing to do with remote loading. A standalone app is just a normal SPA that:

  1. calls createValidateLogin(<AppNavigationHelper>) in its bootstrap.jsx,
  2. passes standaloneAppName="<app>" into the shared store, and
  3. hands its own navInstance to the layout.

All the detail is in Standalone Apps.

Each app compiles the shared libraries into its own bundle at build time. Nothing is fetched from another app at runtime.


What this means in practice

  • There is no host/remote relationship to reason about. Each app is self-contained.
  • Shared code is shared at the source level (via the @aquagen-mf-webapp/* path aliases), not at runtime.
  • Updating a shared library requires rebuilding every app that uses it — there is no independent remote to redeploy.
  • The module-federation.config.js, rspack.config.prod.js, and the main.jsx async boundary can all be treated as inert with respect to how the apps run today.

Next steps