Micro Frontends for Brand Sites: Multi-Team Collaboration, Stack Isolation, and Independent Deploys

Micro frontends solve an organizational collaboration problem, not a technology problem. Once you have more than two frontend teams, a single codebase past 500,000 lines, and teams releasing on different schedules...

微前端:什么时候拆,什么时候别拆Micro frontends: when to split, when not to 微前端是组织问题的技术解 —— 1个团队别硬上It solves org problems, not tech ones — skip if 1 team 壳应用(Shell):路由+布局+公共依赖Shell: routing, layout, shared deps 统一导航 · 统一登录 · 独立部署子应用Unified nav/login · independent sub-app deploys 子应用通过import-map或模块联邦加载Sub-apps loaded via import-map or module federation 子应用A:营销站Sub-app A: marketing Next.js · SEO优先Next.js · SEO first 市场团队独立发布Marketing ships independently 子应用B:用户中心Sub-app B: user portal React/Vue · 交互优先React/Vue · UX first 产品团队独立发布Product ships independently 子应用C:后台管理Sub-app C: admin Vue/Angular · 内部工具Vue/Angular · internal tools 运维团队独立发布Ops ships independently 什么时候拆When to split 2个以上前端团队,代码库超过50万行2+ teams, 500k+ LOC monorepo 各团队发布节奏不同(周更vs月更)Different release cadences 技术栈升级互相拖累Stack upgrades block each other 什么时候别拆When NOT to split 1个团队,代码库少于10万行1 team, under 100k LOC 只有一个发布节奏,无独立部署需求Single cadence, no need to ship alone SEO要求页面级一体化渲染SEO needs unified page render
Micro Frontend Architecture Layers and When to Split (or Not)

Micro Frontends for Brand Sites: Multi-Team Collaboration, Stack Isolation, and Independent Deploys

Bottom line first: Micro frontends solve an organizational collaboration problem, not a technology problem. Splitting into micro frontends only pays off once you have more than two frontend teams, a single codebase past 500,000 lines, and teams releasing on different schedules. Counterintuitively, for a B2B brand site that is mostly a marketing site, micro frontends are usually over-engineering. A team of fewer than 20 people that splits into micro frontends just triples the complexity of builds, deploys, and debugging, and ships slower, not faster. The rule: fewer than 8 people on the team and fewer than 100,000 lines of code, don’t touch micro frontends.

1. What Micro Frontends Actually Solve

Micro frontends split one frontend app into multiple sub-apps by business domain. Each sub-app is built and deployed by its own team, and a shell app assembles them all into the same page. Think of it as microservices for the frontend: the backend breaks a big system into services that deploy independently, and the frontend can do the same.

It solves three specific pain points. First, multiple teams editing the same codebase run into merge conflicts more and more often. Second, team A wants to upgrade to React 19 while team B is still on React 17, and each holds the other back. Third, a small change requires a full build and a site-wide release, with regression testing across the whole site and rising risk. All three come from organizational scale, not from a lack of technical skill.

The counterintuitive part: the payoff from micro frontends scales with team size. The smaller the team, the more micro frontends cost you. A 3-person frontend team that splits into micro frontends adds three layers of complexity, a shell app, route coordination, and cross-app communication, when they never had merge conflicts to begin with. For how to choose a WordPress stack, see WordPress Tech Stack Selection.

Metrics Not a fit for micro frontends Micro frontends worth considering Micro frontends required
Frontend teams 1 2 3 or more
Lines of code Under 100,000 100,000 to 500,000 Over 500,000
Release cadence Once a week, together Some teams ship monthly Mix of weekly and daily
Stack conflicts Fully unified A few conflicts Multiple frameworks side by side
Product type Marketing site only Marketing site plus a simple admin Marketing site plus complex SaaS plus admin
Deploy complexity One repo, one build One repo, multiple builds Multiple repos, multiple builds

2. Three Common Approaches and How to Choose

The first is Module Federation, a built-in webpack 5 feature. Each sub-app declares which modules it exposes at build time, and the host app loads them at runtime. The upside is tight integration; the downside is that webpack versions must match and debugging gets complicated. Best for React/Next.js teams already on webpack.

The second is import-map + SystemJS. Sub-app URLs are declared in a JSON file at runtime, and the host app loads them on demand. The upside is complete stack isolation, so sub-apps can be React, Vue, Svelte, whatever you like. The downside is that you handle cross-app style isolation and routing coordination yourself.

The third is a monorepo with multiple apps (Monorepo + separate builds), managed with Nx or Turborepo, where each package builds and deploys independently. The upside is easy code sharing; the downside is that the bigger the repo, the slower the build, so it does not suit very large teams. For how to structure internal linking, see internal linking system.

Solution Stack isolation Learning curve Build complexity Best for
Module Federation (Webpack 5) Medium (same host framework) 2 to 3 weeks Medium React teams, 20 to 50 people
import-map + SystemJS High (frameworks can mix) 3-4 weeks High Multiple frameworks, 50+ people
Monorepo + multiple apps Low (shared dependencies) 1 to 2 weeks Low Multiple teams on one framework, 10 to 30 people
iframe micro-frontend Extremely high Extremely low Low Temporarily integrating a third-party page

3. When does a B2B site really need micro-frontends?

A purely marketing B2B site, with only a homepage, product pages, a blog, About Us and Contact Us, does not need micro-frontends. Sites like this usually run under 50,000 lines of code, which one person can maintain without much trouble, so splitting into micro-frontends just creates work for yourself.

What really needs them is a site that combines a marketing site, a customer portal and a dealer admin panel. Take an industrial platform going global: the marketing content is owned by the marketing team (Next.js, SEO first), the customer ordering and lookup system by the product team (React, interaction first), and the dealer admin panel by the ops team (Vue, tooling first). The three teams release on different schedules, use different stacks, and each owns over 100,000 lines of code. In that case, micro-frontends stitch the three sub-apps into different routes under one domain, and each team deploys independently without affecting the others. For how site monitoring works across multiple apps, see Site monitoring and alerts.

A real-world example: a SaaS company going global had a marketing site on Next.js and a user dashboard on React + Redux, originally deployed on different subdomains. They found that after logging in, users jumping from the marketing site to the dashboard crossed domains and the experience broke. They used Module Federation to merge both apps into one host app, with a unified nav bar, shared login state, and independent deployment. Changes to the marketing site do not affect the dashboard, and changes to the dashboard do not affect the marketing site. Release frequency went from once a week to twice a day.

Challenge How a monolith does it How micro-frontends do it Benefit
Release frequency Full regression, once a week Ship sub-apps independently, multiple times a day Release 5 to 10 times faster
Tech stack upgrades Upgrade everything at once, high risk Upgrade sub-apps one at a time Upgrade cycles drop from quarters to weeks
Team collaboration Frequent merge conflicts in one repo Separate repos, agreed interfaces 80% fewer merge conflicts
Blast radius of failures One bug takes down the whole site A sub-app crash only affects its own area Smaller failure blast radius
Onboarding new hires Must understand the entire site Only need to know their own sub-app Onboarding drops from 4 weeks to 1

Four: the three biggest pitfalls of micro frontends

Pitfall one: style pollution. Two sub-apps both use Bootstrap, and when loaded on the same page, the styles fall apart. The fix is CSS namespacing (prefix each sub-app) or Shadow DOM isolation. It’s not a technical challenge, but you must set the rules early in the project, or painful rewrites follow.

Pitfall two: cross-app communication. A user fills out a form on the marketing site and wants to bring that data to the dashboard in the user center. If the two sub-apps are fully independent, communication relies on URL parameters or localStorage, which gets messy as data grows. The fix is a global state manager (like zustand) in the shell app, with sub-apps reading and writing through agreed interfaces. Don’t let sub-apps call each other directly.

Pitfall three: performance fragmentation. Each sub-app loads its own copy of React, so users download three copies of React and total JS size jumps from 500KB to 1.2MB. The fix is to put shared dependencies like React and Vue in the shell app, with sub-apps referencing them through a shared scope instead of bundling duplicates. For managing third-party scripts, see Managing third-party scripts.

Pitfall Symptoms Solution Preventive action
Style pollution Sub-app A’s buttons take on sub-app B’s styles CSS prefixes or Shadow DOM Set style rules early in the project
Messy shared state Data lost between sub-apps Centralized state management in the shell app Agree on shared interfaces and data structures
Duplicate JS bundles Each sub-app bundles its own framework Hoist shared dependencies to the shell app Analyze duplicate bundles at build time
Out-of-sync routing Sub-app returns 404 after refresh Centralized routing in the shell app Configure routing rules in one place
Hard to debug Errors with no clue which sub-app they came from Unified error monitoring + sub-app tags Sentry with sub-app tags

FAQ

How is a micro frontend different from an iframe? Can’t I just use an iframe?
An iframe is the simplest micro frontend, with full style and JS isolation, but it has three hard limits: routing can’t sync with the main app (state inside the iframe is lost on refresh), performance overhead is high (each iframe loads its own JS environment), and it’s bad for SEO (crawlers don’t index iframe content). Micro frontends replace iframes with JS module loading, so routing syncs, dependencies are shared, and SEO works normally. But if you’re just embedding a third-party customer chat widget, an iframe is perfectly fine, no need for micro frontends.
Should a 5-person frontend team split an 80k-line codebase into micro-frontends?
No. An 80k-line codebase is still comfortable for a 5-person team, and you only hit two or three merge conflicts a week. Once you split into micro-frontends, the shell app, build coordination, style isolation, and cross-app communication will eat up at least half of one person’s time. Wait until the codebase hits 200k lines, the team grows to 10, or a second tech stack shows up. Split now and complexity grows faster than efficiency.
Do micro-frontends slow down first paint?
Yes, if you don’t optimize. Each sub-app loads its own JS, so the first paint waits for multiple JS bundles to download, and LCP can be 200 to 500 ms slower than a monolith. The fix: server-render the shell app, lazy-load sub-apps by route, and share common dependencies (React/Vue) instead of bundling them twice. Done right, micro-frontends can match or beat a monolith on first paint, because each sub-app can be cached independently.
Can a WordPress site do micro-frontends?
Native WordPress isn’t suited to it, but you can go hybrid: render marketing pages with WordPress, then build the user center and admin as standalone React/Vue sub-apps stitched together by routing. That’s really a variant of headless architecture, not true micro-frontends. True micro-frontends need multiple independently deployed sub-apps, and WordPress’s all-in-one theme model doesn’t support that. If you’re already on Next.js, Module Federation is a more natural fit.
How do you set up deployment for micro-frontends?
Each sub-app has its own CI/CD pipeline: commit code, it builds automatically, the output goes to a CDN or object storage, and the version number in the import map updates. The shell app only updates the import map on each release, without rebuilding sub-apps. So when marketing changes the homepage, they just ship the marketing sub-app and it’s live five minutes later, no full-site rebuild. Rollbacks work the same way: point the import map at the old version and you’re done in 30 seconds.
Do micro-frontends affect SEO?
Yes, if you render purely on the client. Googlebot can execute JS, but waiting for sub-apps to load before rendering content hurts crawl efficiency. The right approach: server-render or statically generate marketing sub-apps (Next.js SSR), and let admin sub-apps render purely on the client since they don’t need SEO. Don’t make pages that need SEO into client-only sub-apps.

Final thoughts

Micro-frontends are a scale-driven architectural decision. When your team is small, they’re a burden; when your team is large, they’re the cure. Whether to split shouldn’t be decided by whatever’s trending in tech, but by the pain you’re actually feeling right now: Are you resolving merge conflicts every week? Does changing a single line of copy still trigger a full regression test? Are two teams blocking each other because their tech stacks don’t match? If you answer “yes” to two of those three, then consider splitting.

Start by splitting off your single biggest pain point: take the sub-app you ship most often (usually the campaign landing page) and make it independent, leaving everything else alone for now. Run it for three months and check the payoff: if releases really do go out faster and merge conflicts really do drop, split off a second one. Don’t carve your whole site into five or six sub-apps on day one, that’s just digging yourself a hole.

One line worth remembering: micro-frontends are a scalpel for big teams that can’t split any other way, not a decoration for small sites that haven’t grown up yet. If your team isn’t at that scale, splitting just turns a simple problem into a complicated one.

Crater
Crater Crater experts

Official Organization · Crater

Crater is a go-global services company specializing in WordPress standalone site development + Google SEO + GEO full-funnel growth, serving sectors including smart hardware, industrial equipment, SaaS, and new energy.

Product CapabilitiesMethodology WhitepaperIndustry Report
965articles shared
78knowledge base articles