emp

Configure EMP v4 projects with Module Federation, plugins, and validation gates.

2.4k|230|Updated Oct 29, 2020
One-click install
npx skills add https://github.com/empjs/emp --skill emp
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: emp
Source: https://github.com/empjs/emp/tree/main/skills/emp
Command: npx skills add https://github.com/empjs/emp --skill emp

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Setting up EMP v4 micro-frontend projects involves many moving parts—host/remote federation wiring, shared singleton dependencies, plugin selection, DTS generation, and release validation—and getting any of them wrong leads to broken builds or runtime failures. This Skill gives agents a structured, repository-grounded path for each task instead of generic bundler advice.

Core Features & Use Cases

  • Project Setup & Diagnostics: Create new EMP v4 projects with emp create, dry-run plans, and emp doctor --json environment checks before writing files.
  • Module Federation Wiring: Configure host/remote exposes, remotes, shared singletons, manifests, runtime scope, and DTS via pluginRspackEmpShare(...).
  • Plugin Selection: Choose framework plugins (React, Vue 2/3), CSS toolchains (Tailwind CSS 4, PostCSS, Lightning CSS, Stylus), and quality packages with explicit React Compiler rules.
  • Validation & Release Evidence: Run repository gates (ci:verify, apps:acceptance), release dry-runs, and release acceptance HTML for formal releases.
  • Use Case: An agent asked to "add a Vue 3 remote to my React host" loads the module-federation reference, writes the correct pluginRspackEmpShare config on both sides, and verifies the manifest and browser rendering.

Quick Start

Use the emp skill to create a new EMP v4 project with a React host and Vue remote, then validate it with the doctor and acceptance commands.

Frequently Asked Questions about emp

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a new EMP v4 project with a React host and Vue remote?

Run `emp create "React 主应用 + Vue 子应用"` to scaffold the workspace, or add `--dry-run --json` to preview the plan without writing files. The flow generates `emp.intent.yaml`, `pnpm-workspace.yaml`, host and user apps, and an `emp-report.json` with command results.

How do I configure Module Federation host and remote in EMP v4?

Use `pluginRspackEmpShare` from `@empjs/share/rspack` in `emp.config.ts`. Remotes declare `name`, `exposes`, and shared singletons; hosts declare `remotes` pointing to the remote's `mf-manifest.json` URL, then verify loading in a browser.

Does EMP v4 support React Compiler?

Yes, `@empjs/plugin-react` supports React Compiler but it is never enabled automatically. React 19 apps can set `reactCompiler: true`; React 17/18 apps need `react-compiler-runtime` and an explicit `target`, with `compilationMode: 'annotation'` recommended for gradual adoption.

What Node.js and pnpm versions does EMP v4 require?

EMP v4 requires Node.js `^20.19.0 || >=22.12.0` and pnpm 12 (`[email protected]`). Run `emp doctor --json` to verify your runtime and package manager before creating or migrating a project.

Why is my EMP build passing but the remote module not rendering?

Build success alone is not sufficient validation. Check that the manifest is reachable, `exposes` match the host import path, `remotes` URLs point to the correct environment, and shared singletons resolve to expected versions, then confirm rendering in the browser console and network panel.