Library / SDK
module-federation/module-federation-examples avatar
module-federation/module-federation-examples

module-federation-examples: What the Reference Repository Actually Contains

Implementation examples of module federation , by the creators of module federation

6,148 stars1,803 forksJavaScriptMIT

At a glance

What is it?
The official example collection from the Module Federation creators is a pnpm workspace of runnable demos rather than a library. It is most useful as a working reference for host and remote wiring, and least useful if you want a maintained product to depend on.
Who is it for?
Adopt it as a reading and copying reference when you are wiring your first host and remote, or when you need to see how a specific bundler or framework combination is configured. Do not adopt it as a dependency, and do not expect a supported product: the repository has no published releases, the README points to the docs site and a paid book for guidance, and the README tells you to remove the proprietary examples before running locally.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 8 days ago.
What is it written in?
Mainly JavaScript, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 14, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • module-federation/module-federation-examples6,148 ★ · +2
Star history
Repository2026-09-232026-11-14
module-federation/module-federation-examples6.1k6.1k

2 Stars in the last 52 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

A demo workspace, not a package you install

The repository is a collection of implementation examples, described in its own README as a place to show how Webpack 5's Module Federation can be used. It is published under MIT and the root package.json is marked private with the name module-federation-examples-root and version 0.0.0. That combination tells you what it is: a monorepo of runnable demos, not something you add to a dependency list.

The audience is engineers who already know they want to split a frontend into separately deployed pieces and need to see the wiring. The README makes the scope explicit: federation is not a JavaScript-only or React-only feature, and images, CSS, JSON and WASM can be federated as long as Webpack can process the import. The top-level directories bear that out, with separate entries for CSS isolation, federated CSS with SSR, Apollo Client, i18next with Next.js, and several Vite variants for React, Vue 3, Svelte, Solid and Angular.

What it does not give you is a supported runtime. The repository has no published GitHub releases, and the README routes people who want structured guidance to the Module Federation docs site and to a paid book rather than to versioned documentation inside the repo.

How the examples are organised and what actually runs

The mechanism is a pnpm workspace. The root package.json pins packageManager to [email protected], and the README states the examples use pnpm and workspaces. Each example directory is its own package with its own start command, which is why the README warns that some examples use a different command such as dev or serve instead of start.

The examples divide into recognisable families. The basic-host-remote directory is the smallest complete case: one application exposes a module and another consumes it. The different-react-versions directories cover hosts and remotes running mismatched React majors, which is the scenario that makes shared dependency negotiation visible. The dynamic-remotes and dynamic-system-host directories cover remotes resolved at runtime rather than declared at build time. The federated-npm and federated-library-from-cdn directories deal with sharing packages, including from a CDN. There is also a frontend-discovery-service directory and a dashboard-admin example built on Rspack and Material UI.

Because it is a workspace, installing at the root links everything. That is convenient, and it is also why the README tells you to remove proprietary example directories before installing from a git checkout.

Installing module-federation-examples and running a first example

The README gives the install path directly. From a git checkout, remove the proprietary example directories, make sure pnpm is installed, and install at the repository root:

bash
pnpm i

After that, the README says you can run pnpm start from any of the non-proprietary examples. Change into the example you want and start it:

bash
cd basic-host-remote
pnpm start

Expect the command to start the host and remote applications for that example, and expect the exact script name to vary. The README states that some examples use dev or serve instead of start, so check the example's own package.json before assuming the command failed.

The root package.json also carries pnpm overrides that pin shared tooling, including React type packages and Playwright, plus packageExtensions that add peer dependencies for the Angular Vite plugin and a runtime dependency for @module-federation/bridge-react. If you copy configuration out of an example into your own project, those root-level overrides are part of why the example resolves cleanly, and they will not follow the code you copy.

Where the examples stop being a good model

The most concrete limitation is that this is a demo surface, not a maintained product. The README asks contributors to help, and the repository carries a SECURITY.md and a Husky setup, but it has no published releases to pin against. If your team needs a versioned artifact with a changelog, this repository is the wrong source; the docs site is where the README sends you.

The second limitation is the proprietary directories. The README instructs you to remove them before installing from a checkout, which means the full workspace as it exists on the default branch is not guaranteed to install for an outside user. That is a real friction point for anyone who clones and runs pnpm i without reading the notes first.

The third is version drift. With examples spanning React 16, 17 and 18, multiple Vite plugins, Modern.js, Angular Universal SSR and Rspack, the configurations are not interchangeable. Copying a remote configuration from an older React example into a current project can produce a setup that runs but shares the wrong dependency, and the README does not document a migration path between examples. Treat each directory as a self-contained snapshot of one combination.

Finally, the README's list of companies using Module Federation is a list of adopters, not evidence about this repository's quality. It says nothing about whether a given example still runs.

Alternatives and how they differ in approach

The most direct alternative is the Module Federation documentation site at module-federation.io, which the README links as the canonical reference. The difference in approach is that the docs explain the runtime and the plugin APIs as concepts, while this repository shows complete, runnable applications. If you want to understand what a shared scope does, read the docs. If you want to see a host and remote that actually boot, read an example here.

The second alternative is the Universe repository, which the README lists under Module Federation Universe.

The third is the paid book, Practical Module Federation, sold through a Shopify storefront and described in the README as receiving updates over the following year alongside Webpack releases. It is a different medium for the same subject: prose and guidance instead of directories you run. The README also lists paid consultation options, which is worth knowing if the examples do not answer your question.

Maintenance, licence and the cost of keeping up

The repository is not archived, and the last push was on 2026-07-08. That is recent enough that the examples track current bundler work, but the absence of published releases means there is no version number to track and no changelog to read before upgrading. Your upgrade signal is the commit history on master, not a release feed.

The licence is MIT, declared in both the repository metadata and the root package.json. That permits reuse and modification with the licence and copyright notice preserved. It does not cover the proprietary example directories the README tells you to remove, and it does not cover the book, the consultations or Zephyr Cloud, all of which are separate commercial offerings mentioned in the README. Nothing here is legal advice; if you plan to ship code derived from an example, read the LICENSE file in the repository rather than relying on the metadata line.

The ongoing cost is toolchain churn rather than API churn. The root package.json pins pnpm, React types, Playwright and an enhanced-resolve override, and lists onlyBuiltDependencies including @module-federation/nextjs-mf, @swc/core, nx and sharp. Those pins move as the examples move, so a fork that copies a single directory inherits the example's dependencies without the root overrides that made them resolve.

Editorial conclusion

Adopt it as a reading and copying reference when you are wiring your first host and remote, or when you need to see how a specific bundler or framework combination is configured. Do not adopt it as a dependency, and do not expect a supported product: the repository has no published releases, the README points to the docs site and a paid book for guidance, and the README tells you to remove the proprietary examples before running locally. Before you copy anything, verify which bundler and framework versions the example targets, whether its start script is start or dev or serve, and whether the directory you picked is one of the proprietary examples the README tells you to remove.

Frequently asked questions

What is module federation?

It is the feature this repository exists to demonstrate: a way for separately built applications to share and consume modules at runtime, introduced in Webpack 5. The README notes it works with any file type Webpack can process, not only JavaScript or React.

Can you use module federation without WebPack?

Yes. The repository contains examples for Vite with React, Vue 3, Svelte, Solid and Angular, plus Modern.js and Rspack directories, alongside the Webpack-based examples. The README also points to the Module Federation docs site as the canonical reference.

Is module federation the same as micro frontend?

The README does not define micro frontends or claim equivalence, so this repository does not settle the question. What it does show is the technical mechanism, with directories such as basic-host-remote and dynamic-system-host demonstrating how one application exposes a module and another consumes it.

Official sources

  1. Issues
  2. License: MIT
  3. module-federation/module-federation-examples on GitHub
  4. Project website
  5. README
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/module-federation-module-federation-examples.svg)](https://hysenlabs.com/projects/module-federation-module-federation-examples)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/module-federation-module-federation-examples.svg)](https://hysenlabs.com/projects/module-federation-module-federation-examples)

Was this useful?