Structure a frontend monorepo that stays fast and decoupled: package boundaries and dependency rules, affected-only builds, remote caching, bundling choices, and bundle budgets.
A monorepo holds many apps and packages in one repository, like the design system, shared utilities, the marketing site, and the product app. A polyrepo setup gives each its own repository.
| Monorepo | Polyrepo | |
|---|---|---|
| Cross-package change | One atomic PR | Coordinated releases across repos |
| Dependency versions | One version of React everywhere (enforceable) | Drift: app A on React 17, app B on 19 |
| Code sharing | Import directly | Publish, version, upgrade |
| Ownership boundaries | Must be enforced with tooling | Enforced by repo permissions |
| CI cost | Grows with the repo unless you build only what changed | Naturally scoped |
| Tooling needed | Workspace manager + task runner + caching | Less, but repeated per repo |
Monorepos win when teams share a lot of code (design system, API clients, types) and you want atomic changes plus a single dependency graph. Google, Meta, Microsoft, Vercel, and Shopify run large frontend monorepos.
Polyrepos win when teams are truly independent, deploy on different cadences with different stacks, or org boundaries require separate access control.
The monorepo's main risk isn't the repo itself. It's that without enforced boundaries, everything ends up importing everything, and you get one big tangled app that happens to have many package.json files.