name: module-federation-expose description: Add or change erxes frontend Module Federation exposes, shared dependencies, widgets, and host-facing plugin entry points.
Skill: Module Federation Expose
Workflow
- Open the plugin's
module-federation.config.tsand identify current exposes and shared dependencies. - Confirm whether the new surface should be a route module, config, widget, relation widget, settings page, or plugin-local component.
- Add exposes only when the module must be loaded by the host or another Module Federation boundary.
- Keep exposed entry points stable and small. Put feature internals under
src/modules,src/pages, or plugin-local shared folders. - Update host references, plugin config, route registration, or widget config when an expose name or path changes.
- Keep shared dependency behavior consistent with nearby plugin configs.
- Run
pnpm nx build <plugin>andpnpm nx lint <plugin>for frontend plugin changes.
Important
- Do not move or rename exposes without updating all host references.
- Do not put general feature UI in
src/widgets; reserve it for widget exports and widget-specific UI. - Do not add shared plugin UI to
frontend/core-ui; move truly shared frontend UI toerxes-uiorui-modulesonly when reuse is clear. - Avoid adding dependencies for an expose unless the existing repo cannot reasonably cover the need.