Production readiness
MFDoctor treats Module Federation as three linked surfaces:
- build configuration,
- emitted manifest/stats/type artifacts,
- federation-wide runtime contracts.
A config can be valid by itself and still fail after deployment. For example,
an externalRuntime remote is only safe when a pure top-level consumer provides
the runtime first. MFDoctor therefore keeps local and cross-project checks
separate.
Coverage map
The rule reference groups every diagnostic by correctness, reliability, performance, security, or tooling. Each rule page includes the impact, a concrete fix, and upstream evidence.
Important distinctions
Core/Rspack/Rsbuild options come from the Module Federation plugin types. They include runtime plugins, manifest, DTS, async startup, external runtime, snapshot optimization, and shared tree shaking.
Vite has its own integration and extra options. Its
normalized option type
adds publicPath, bundleAllCSS, parser timeouts, injection location, SSR
externals, and direct runtime capability flags. A MFDoctor rule says when it is
Vite-only; it does not pretend the setting exists in every bundler.
Production policy
Recommended CI policy — register the plugin and let CI env auto-detect do the
rest (failOn: "error" + SARIF when CI / provider vars are set):
Force CI or local defaults only when needed: mode: "ci", mode: "development",
or an explicit failOn. Use mfdoctor check --ci when running the CLI outside
a CI provider.
Use mfdoctor federation ".mf/doctor/**/project.json" after every application
has produced project.json. This is where name collisions, version/scope
conflicts, missing providers, and external-runtime provider gaps become visible.
Together with plugin emit, that is the green bar — not mfdoctor check alone
(see the agent loop).
For incremental adoption, check in a fingerprint baseline so known debt stays visible in reports without failing the gate. Baselines are debt — prune them as findings are fixed.
MFDoctor stays offline by default. It records normalized config and artifact metadata, not source bodies, secrets, or live remote responses.
Install MFDoctor as a devDependency. Adapters analyze after emit in Node; they
are not part of the client bundle. MF runtimePlugins are covered through the
shared bundler mfOptions object — not by shipping MFDoctor into the runtime.
Research sources
Use primary upstream references when changing rules or claiming Module Federation behavior. The repository contribution guide keeps the maintainer source list. High-level entry points:
- Official configuration index
- Official
mfagent skill - Module Federation Core
- Module Federation Vite
- Vitest docs and UI
The official agent-skill repository currently has no license file. MFDoctor does
not vendor its code or browser asset. MFDoctor-specific agent UX prefers CLI and
plugin finding output; .agents/skills/mf remains for Module Federation
concepts.