> For AI agents: the complete documentation index is available at https://mfdoctor.kevinbeier.com/de/llms.txt, the full documentation bundle is available at https://mfdoctor.kevinbeier.com/de/llms-full.txt.

<!-- mfdoctor locale: de. Technische Bezeichner, CLI-Flags, Regel-IDs, Links und Codebeispiele bleiben byte-kompatibel mit dem kanonischen englischen Vertrag. -->

> Dies ist die deutsche mfdoctor-Dokumentation. Technische Bezeichner, CLI-Flags, Regel-IDs und Codebeispiele bleiben unverändert, damit die Inhalte zwischen den Sprachen vollständig kompatibel bleiben. Verwenden Sie den Sprachumschalter für die kanonische englische Fassung.

# Configuration audit

This page separates common Module Federation config from Vite-only controls.
Use it as a review checklist even when a rule does not yet automate the check.

## Gemeinsame und Core/Rspack/Rsbuild-Optionen

| Option                               | Main risk                                                                           | Practical fix                                                                                                                                                                                                                               |
| ------------------------------------ | ----------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `name`                               | Runtime/global collision                                                            | Use one stable unique name per container                                                                                                                                                                                                    |
| `filename`                           | Missing, unsafe, or hashed remote entry                                             | Use a stable relative `.js` filename (no `[contenthash]`)                                                                                                                                                                                   |
| `library` + `remoteType`             | Producer/consumer format mismatch                                                   | Align global, module, CommonJS, or script contracts                                                                                                                                                                                         |
| `remotes`                            | Bad URL, alias, scope, or offline startup                                           | Prefer HTTPS manifest URLs; test failure recovery                                                                                                                                                                                           |
| `dataPrefetch` / prefetch remotes    | Prefetch/preload misconfig can break load order                                     | Use [`prefetch`](https://module-federation.io/guide/data/data-prefetch.html) after `lazyLoadComponentPlugin` with `<remote>/<expose>` ids; test `preloadRemote` load order. Not checked automatically (no normalize field, low confidence). |
| `shareScope`                         | Isolated pools cannot reuse packages                                                | Align top-level, remote, and item scopes                                                                                                                                                                                                    |
| `exposes`                            | Bad public key or missing source                                                    | Use `./Name` keys and exact paths                                                                                                                                                                                                           |
| `shared`                             | Duplicate frameworks or unsatisfied versions                                        | Align singleton, versions, scope, strictness, and fallback                                                                                                                                                                                  |
| `shared[].packagePath`               | Wrong path redirects version/singleton resolution                                   | Point at an existing package directory or entry file                                                                                                                                                                                        |
| `shared[].layer` / `issuerLayer`     | Webpack layer sharing isolates share pools; host/remote mismatch duplicates modules | Align `layer` and `issuerLayer` across webpack-family projects that declare them. Not checked automatically (SDK confirms the keys; public shared docs and Vite omit them, low confidence).                                                 |
| `runtimePlugins`                     | Missing plugin or unsafe recovery                                                   | Resolve every plugin and test each hook path                                                                                                                                                                                                |
| `getPublicPath`                      | Dynamic-code and asset-base risk                                                    | Keep the stringified function small, static, and reviewed                                                                                                                                                                                   |
| `implementation`                     | Runtime/plugin version skew                                                         | Resolve a compatible `runtime-tools` implementation                                                                                                                                                                                         |
| `dts`                                | Missing/stale consumer contracts                                                    | Generate types in CI and choose an explicit abort policy                                                                                                                                                                                    |
| `dev`                                | Reload/type-HMR behavior differs from build                                         | Document disabled reload features and test remote HMR                                                                                                                                                                                       |
| `manifest`                           | Missing runtime metadata or incomplete asset data                                   | Emit it for releases; keep producer asset analysis enabled                                                                                                                                                                                  |
| `shareStrategy`                      | Startup cost vs late remote failure                                                 | Pick `version-first` or `loaded-first` intentionally                                                                                                                                                                                        |
| Host/remote `shareStrategy` mix      | Inconsistent shared negotiation across the graph                                    | Align federation-wide, or document intentional exceptions                                                                                                                                                                                   |
| Circular remotes                     | Nested init / type extraction can deadlock                                          | Keep the remotes graph a DAG                                                                                                                                                                                                                |
| Remote alias prefixes                | Runtime rejects alias that prefixes another name                                    | Rename aliases so none is a prefix                                                                                                                                                                                                          |
| Nested producer DTS                  | Missing extracted remote types in producer archive                                  | Enable `dts.generateTypes.extractRemoteTypes` (`config/nested-producer-dts-extract`)                                                                                                                                                        |
| `dts.generateTypes.outputDir`        | Type zip path drifts from nested `filename`                                         | Align outputDir with the remote-entry directory layout                                                                                                                                                                                      |
| `dts.generateTypes.compilerInstance` | Default `tsc` can make DTS generation the bottleneck                                | Set `"tsgo"` when type generation is slow                                                                                                                                                                                                   |
| Direct `.js` remotes + DTS           | No type URL without manifests/`remoteTypeUrls`                                      | Prefer manifests or set `remoteTypeUrls`                                                                                                                                                                                                    |
| Non-string `output.publicPath`       | Manifest generation is skipped upstream                                             | Use a string/`auto` publicPath when manifests are required                                                                                                                                                                                  |
| Localhost remotes in CI              | Deployed builds cannot reach loopback remotes                                       | Use deployed URLs for CI/production mfdoctor runs                                                                                                                                                                                           |
| `experiments.asyncStartup`           | Entry exports become async; ignored on old Rspack                                   | Requires Rspack > 1.7.4; await Promise consumers                                                                                                                                                                                            |
| `externalRuntime` pair               | Hard load-order dependency                                                          | One pure provider; externalize only downstream browser remotes                                                                                                                                                                              |
| snapshot/remote/shared removal       | Tree-shaken capability still used                                                   | Never disable a configured capability                                                                                                                                                                                                       |
| shared tree shaking                  | Incomplete deployment union                                                         | Publish the merged secondary artifact and update snapshots                                                                                                                                                                                  |
| `injectTreeShakingUsedExports`       | Conflicts with `server-calc`                                                        | Disable it for deployment-calculated exports                                                                                                                                                                                                |
| `treeShakingDir`                     | No known fallback artifact location                                                 | Configure and publish the directory                                                                                                                                                                                                         |
| shared tree-shaking plugins          | Secondary build misses original transforms                                          | Package only the needed build plugins and pin versions                                                                                                                                                                                      |

Official option pages:
[overview](https://module-federation.io/configure/index.html),
[shared](https://module-federation.io/configure/shared.html),
[DTS](https://module-federation.io/configure/dts.html),
[dev](https://module-federation.io/configure/dev.html),
[manifest](https://module-federation.io/configure/manifest.html),
and
[experiments](https://module-federation.io/configure/experiments.html).

## Vite-spezifische Optionen

| Option                   | Main risk                                    | Practical fix                                                                                                                                    |
| ------------------------ | -------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| `publicPath`             | Browser assets resolve from the wrong origin | Compare config with emitted manifest metadata                                                                                                    |
| `bundleAllCSS`           | Every expose receives every stylesheet       | Keep false unless the global style contract is deliberate                                                                                        |
| `ignoreOrigin`           | Proxy entry origin behavior changes          | Use only with a tested deployment base ([`vite/ignore-origin`](https://mfdoctor.kevinbeier.com/de/rules/vite/ignore-origin.md))                  |
| `virtualModuleDir`       | Invalid or colliding virtual module folder   | Use one simple directory name without slashes ([`vite/virtual-module-dir`](https://mfdoctor.kevinbeier.com/de/rules/vite/virtual-module-dir.md)) |
| `hostInitInjectLocation` | HTML-less/SSR app misses init                | Use `entry` when no usable HTML transform exists                                                                                                 |
| parser timeouts          | Partial dependency discovery                 | Use an idle timeout for large active builds                                                                                                      |
| `varFilename`            | Sync script contract differs from ESM entry  | Load it through a synchronous script and test the global name                                                                                    |
| `remoteHmr`              | Dev-only remote reload is Vite-plugin-only   | Keep on Vite hosts; ignored on Enhanced / webpack-family                                                                                         |
| `target`                 | Browser and Node output rules mix            | Set the real execution environment                                                                                                               |
| `ssrExternals`           | Server-only package gets bundled             | Externalize explicit Node-only dependencies                                                                                                      |
| direct capability flags  | Useful runtime feature is removed            | Match flags to actual remotes/shared/snapshot use                                                                                                |

Vite source:
[option normalizer](https://github.com/module-federation/vite/blob/321d7db8a4b2a1764b3a7cdc16246222d97231ac/src/utils/normalizeModuleFederationOptions.ts)
and
[plugin integration](https://github.com/module-federation/vite/blob/321d7db8a4b2a1764b3a7cdc16246222d97231ac/src/index.ts).

Webpack, Rspack, Rsbuild, and Modern.js ignore Vite-only keys such as
`virtualModuleDir`, `hostInitInjectLocation`, `bundleAllCSS`, `remoteHmr`,
and `varFilename`. mfdoctor reports them as
[`config/copied-vite-options-on-webpack`](https://mfdoctor.kevinbeier.com/de/rules/config/copied-vite-options-on-webpack.md).
There is no Rsbuild or Modern.js analogue of
[`vite/host-init-inject-ssr`](https://mfdoctor.kevinbeier.com/de/rules/vite/host-init-inject-ssr.md) until those
plugins expose a public host-init inject switch, see
[Limitations](https://mfdoctor.kevinbeier.com/de/limitations.md#ssr-host-init-inject-vite-only).

## Ausgabeprüfung

Config review is not enough. In CI, confirm:

1. the configured remote entry exists;
2. manifest name and entry metadata match config;
3. every expose appears and has assets;
4. manifest shared versions match the lockfile install;
5. type metadata and archives exist when DTS is enabled;
6. every application's `project.json` passes federation-wide analysis.
