From 86880a8a91168ddd70939246d952b65ac781878c Mon Sep 17 00:00:00 2001 From: Steven Prybylynskyi Date: Thu, 30 Apr 2026 20:29:24 +0200 Subject: [PATCH] docs: clarify that remote-entries.json is user-produced (#51) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add an explicit note that remote manifest files are NOT generated by webpack or ModuleFederationPlugin — users must produce and host them themselves alongside their builds. Split the per-remote vs registry manifest formats into clearly labeled subsections. --- README.md | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b847a77..c44dad1 100644 --- a/README.md +++ b/README.md @@ -210,6 +210,19 @@ The `remoteEntryUrls` option is a simple key-value map of remote names and their ### Remote Manifest files +> **Note:** Remote manifest files (e.g. `remote-entries.json`, `mfe-app-1-remote-entry.json`) +> are **not** generated by webpack or `ModuleFederationPlugin`. They are plain JSON files that +> **you produce and host yourself** — typically as part of your CI/deployment pipeline, alongside +> the `remoteEntry.js` of each microapp. The filename is arbitrary; `remote-entries.json` is just +> the convention used in these examples. +> +> Their purpose is to let the host discover where each remote's `remoteEntry.js` lives in a given +> environment without hardcoding URLs. This plugin fetches them at build time to learn the +> remotes' base URLs and download their `.d.ts` files from `/@types/index.d.ts`. +> +> A minimal way to generate one is to write a small post-build script that emits a JSON file +> containing the public URL of the just-built `remoteEntry.js` and uploads it next to the bundle. + Manifest files, when provided, are fetched every time the types are downloded. Example of a configuration: @@ -232,7 +245,10 @@ new ModuleFederationTypesPlugin({ }) ``` -It's expected that a JSON will contain an object with a `url` property: +#### Per-remote manifest format + +For each entry in `remoteManifestUrls` other than `registry`, the JSON is expected to be an +object with a `url` property pointing at that remote's `remoteEntry.js`: ```json { @@ -240,6 +256,8 @@ It's expected that a JSON will contain an object with a `url` property: } ``` +#### Registry manifest format + For the `registry` field in `remoteManifestUrls` or for the single `remoteManifestUrl` option, multiple remote entry URLs can be substituted in a single JSON file. Depending on your architecture, this could be the only URL that you need to specify.