Skip to content

Commit 86880a8

Browse files
docs: clarify that remote-entries.json is user-produced (#51)
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.
1 parent f625065 commit 86880a8

1 file changed

Lines changed: 19 additions & 1 deletion

File tree

README.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,19 @@ The `remoteEntryUrls` option is a simple key-value map of remote names and their
210210

211211
### Remote Manifest files
212212

213+
> **Note:** Remote manifest files (e.g. `remote-entries.json`, `mfe-app-1-remote-entry.json`)
214+
> are **not** generated by webpack or `ModuleFederationPlugin`. They are plain JSON files that
215+
> **you produce and host yourself** — typically as part of your CI/deployment pipeline, alongside
216+
> the `remoteEntry.js` of each microapp. The filename is arbitrary; `remote-entries.json` is just
217+
> the convention used in these examples.
218+
>
219+
> Their purpose is to let the host discover where each remote's `remoteEntry.js` lives in a given
220+
> environment without hardcoding URLs. This plugin fetches them at build time to learn the
221+
> remotes' base URLs and download their `.d.ts` files from `<baseUrl>/@types/index.d.ts`.
222+
>
223+
> A minimal way to generate one is to write a small post-build script that emits a JSON file
224+
> containing the public URL of the just-built `remoteEntry.js` and uploads it next to the bundle.
225+
213226
Manifest files, when provided, are fetched every time the types are downloded.
214227

215228
Example of a configuration:
@@ -232,14 +245,19 @@ new ModuleFederationTypesPlugin({
232245
})
233246
```
234247

235-
It's expected that a JSON will contain an object with a `url` property:
248+
#### Per-remote manifest format
249+
250+
For each entry in `remoteManifestUrls` other than `registry`, the JSON is expected to be an
251+
object with a `url` property pointing at that remote's `remoteEntry.js`:
236252

237253
```json
238254
{
239255
"url": "https://assets.mydomain.com/mfe-app/remoteEntry.js"
240256
}
241257
```
242258

259+
#### Registry manifest format
260+
243261
For the `registry` field in `remoteManifestUrls` or for the single `remoteManifestUrl` option,
244262
multiple remote entry URLs can be substituted in a single JSON file.
245263
Depending on your architecture, this could be the only URL that you need to specify.

0 commit comments

Comments
 (0)