mf-perf
Step 1: Call the mf-context Skill (pass $ARGUMENTS) to collect MFContext.
Step 2: Serialize MFContext to JSON and pass it to the check script via the --context argument:
node scripts/performance-check.js --context '<MFContext-JSON>'
Provide recommendations for each item in the output results and context.bundler.name:
PERF · info — dev.disableAssetsAnalyze (applies to all projects)
- Disabling bundle size analysis during local development significantly improves HMR speed
- Add to the Rsbuild config:
dev: { disableAssetsAnalyze: true }
PERF · info — Rspack splitChunks optimization (shown only when bundler.name is rspack or rsbuild)
- Setting
splitChunks.chunksto"async"reduces initial bundle size and speeds up first-screen loading - Add to the build config:
output: { splitChunks: { chunks: 'async' } }
PERF · info — TypeScript DTS optimization (shown only when typescript dependency is detected)
- If type generation (DTS) is the main bottleneck, options include:
- Temporarily disable DTS: set
dts: falsein the@module-federation/enhancedconfig - Switch to
ts-gofor significantly faster type generation
- Temporarily disable DTS: set
Step 3: After presenting the DTS recommendation, ask the user:
"Would you like me to automatically try switching to
ts-goand verify compatibility?"
If the user confirms, execute the following steps in order:
-
Backup — copy the current generated type output directory (e.g.
@mf-types/) to a timestamped backup path such as@mf-types.bak.<timestamp>/ -
Configure — set
dts.generateTypes.compilerInstance = "tsgo"in the Module Federation config -
Install — install the required package:
npm install @typescript/native-preview --save-dev(use the project's actual package manager from MFContext)
-
Regenerate — run:
npx mf dts -
Verify — diff the newly generated type output against the backup:
- If the output is identical: inform the user that
ts-gois compatible and the switch is safe; offer to remove the backup - If the output differs: revert the config change, restore the backup, and explain clearly what differs (e.g. missing declarations, changed signatures) so the user can decide whether the difference is acceptable
- If the output is identical: inform the user that
Webpack projects do not show Rspack-specific entries to avoid irrelevant suggestions.
More from module-federation/core
mf
All-in-one Module Federation skill. Use when the user asks anything about MF — concepts, configuration, runtime API, shared dependencies, type errors, runtime error code troubleshooting, slow builds, Bridge integration, or adding MF to an existing project.
422mf-integrate
Integrate Module Federation into an existing project — add provider (exposes modules) or consumer (loads remote modules) configuration. Use when the user wants to add Module Federation to an existing Rsbuild / Rspack / Webpack / Modern.js / Next.js / Vite project, set up a remote, create a host app, or quickly consume the demo provider to see MF working. Default role is consumer.
107mf-docs
Answer questions about Module Federation (MF) — configuration, runtime API, build plugins (Webpack/Rspack/Rsbuild/Vite), framework integration (React/Vue/Next.js/Modern.js/Angular), shared dependencies, exposes, remotes, debugging, troubleshooting, and micro-frontend architecture. Use this skill when the user asks anything about module federation, remote modules, shared deps, mf-manifest, federation runtime, or micro-frontends with MF.
100mf-context
Collects the current project's Module Federation context (MFContext) and outputs a structured summary. Serves as the data foundation for all MF diagnostic Skills; can also be called standalone to quickly understand the project's MF configuration.
66mf-shared-deps
Check Module Federation shared dependency configuration: detect shared/externals conflicts, antd/arco transformImport blocking shared deps, and multiple versions of the same shared package in build artifacts. Use when shared dependencies fail to be shared, or host and remote load duplicate instances of a library.
61mf-config-check
Check Module Federation build configuration: verify correct MF plugin for the bundler, async entry configuration, exposes key format, and exposes path existence. Use when modules cannot be correctly exposed, expected modules are missing from the build output, or runtime initialization errors occur.
56