microfrontends
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseVercel Microfrontends
Vercel Microfrontends
Split a large application into independently deployable units that render as one cohesive app. Vercel handles routing on its global network using .
microfrontends.jsonCore concepts: default app (has , serves unmatched requests) · child apps (have path patterns) · asset prefix (prevents static-asset collisions) · independent deployments.
microfrontends.jsonroutingFrameworks: Next.js (App Router + Pages Router), SvelteKit, React Router, Vite — all via .
@vercel/microfrontendsCLI ( / ):
vercel microfrontendsvercel mf- — create a new group; interactive by default, or fully non-interactive with
create-group(options:--non-interactive,--name(repeatable),--project,--default-app,--default-route(repeatable, format:--project-default-route, required for each non-default project in non-interactive mode),<project>=<route>to skip confirmation prompt); note:--yesis blocked if adding the projects would exceed the free tier limit — the user must confirm billing changes interactively--non-interactive - — add the current project to an existing group; requires interactive terminal (options:
add-to-group,--group)--default-route - — remove the current project from its group; requires interactive terminal (option:
remove-from-groupskips project-link prompt only)--yes - — delete a group and all its settings, irreversible; requires interactive terminal (option:
delete-groupto pre-select group)--group - — retrieve group metadata (project names, frameworks, git repos, root dirs); useful for automating setup (options:
inspect-group,--group,--format=json)--config-file-name - — pull remote
pullfor local development (option:microfrontends.json)--dpl - — local dev proxy ·
microfrontends proxy— print auto-assigned portmicrofrontends port
将大型应用拆分为可独立部署的单元,这些单元可渲染为一个连贯的应用。Vercel 通过 在其全球网络上处理路由。
microfrontends.json核心概念: 默认应用(包含,处理未匹配的请求)· 子应用(包含路径模式)· 资源前缀(避免静态资源冲突)· 独立部署。
microfrontends.jsonrouting支持框架: Next.js(App Router + Pages Router)、SvelteKit、React Router、Vite —— 均可通过实现。
@vercel/microfrontendsCLI 命令( / ):
vercel microfrontendsvercel mf- —— 创建新组;默认是交互式模式,使用
create-group可切换为完全非交互式模式(可选参数:--non-interactive、--name(可重复使用)、--project、--default-app、--default-route(可重复使用,格式:--project-default-route,非交互式模式下每个非默认项目都需要该参数)、<project>=<route>用于跳过确认提示);注意:如果添加项目会超出免费层限制,则--yes模式会被禁用——用户必须以交互式方式确认计费变更--non-interactive - —— 将当前项目添加到现有组;需要交互式终端(可选参数:
add-to-group、--group)--default-route - —— 将当前项目从所属组中移除;需要交互式终端(可选参数:
remove-from-group仅用于跳过项目链接提示)--yes - —— 删除组及其所有设置,操作不可逆;需要交互式终端(可选参数:
delete-group用于预先选择组)--group - —— 获取组元数据(项目名称、框架、Git仓库、根目录);对自动化设置很有用(可选参数:
inspect-group、--group、--format=json)--config-file-name - —— 拉取远程
pull用于本地开发(可选参数:microfrontends.json)--dpl - —— 本地开发代理 ·
microfrontends proxy—— 打印自动分配的端口microfrontends port
Finding Detailed Information
查找详细信息
This skill includes detailed reference docs in the directory. Do not read all references upfront. Instead, search or grep the relevant file when the user asks about a specific topic:
references/| Topic | Reference file |
|---|---|
Getting started, quickstart, framework setup, | |
| Path expressions, asset prefixes, flag-controlled routing, middleware | |
| Local proxy setup, polyrepo config, Turborepo, ports, deployment protection | |
Inspecting groups ( | |
Testing utilities ( | |
| Deployment protection, Vercel Firewall, WAF rules for microfrontends | |
When the user asks about a specific topic, use grep or search over the relevant reference file to find the answer without loading all references into context.
本技能在目录中包含详细的参考文档。请勿预先阅读所有参考文档。相反,当用户询问特定主题时,搜索或筛选相关文件:
references/| 主题 | 参考文件 |
|---|---|
入门指南、快速开始、框架设置、 | |
| 路径表达式、资源前缀、标志控制路由、中间件 | |
| 本地代理设置、多仓库配置、Turborepo、端口、部署保护 | |
检查组( | |
测试工具( | |
| 部署保护、Vercel防火墙、微前端WAF规则 | |
当用户询问特定主题时,通过搜索或筛选相关参考文件来查找答案,无需将所有参考文档加载到上下文环境中。