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

# `config/rsbuild-mf-api-generation`

- Category: **correctness**
- Default severity: **error**

## Issue

Rsbuild Module Federation 1.5 (`moduleFederation.options`) and `@module-federation/rsbuild-plugin` v2 use different option surfaces. Copied or nested keys are ignored or crash during generate/runtime instead of emitting the expected MF API, types, or manifest.

## How to fix it

Use `@module-federation/rsbuild-plugin` with a flat `pluginModuleFederation({ ... })` config for MF 2.0 generation options (`dts`, `manifest`, `getPublicPath`, …). Keep Rsbuild `moduleFederation.options` for MF 1.5 only. Pass `target` / `environment` / `ssrDir` as the plugin second argument, never under a nested `options` bag.

Suppress or retarget with `rules["config/rsbuild-mf-api-generation"]` set to `"off"` or a severity, see [Suppressions and allowlists](https://mfdoctor.kevinbeier.com/suppressions.md).

## Sources

- [Official source](https://module-federation.io/integrations/build-tool/rsbuild)
- [Official source](https://rsbuild.rs/guide/advanced/module-federation)
- [Official source](https://module-federation.io/configure/index.html)
