Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 `<baseUrl>/@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:
Expand All @@ -232,14 +245,19 @@ 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
{
"url": "https://assets.mydomain.com/mfe-app/remoteEntry.js"
}
```

#### 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.
Expand Down
Loading