TypeScript Monorepos That Stay Fast
Project references, incremental builds, and package boundaries that keep CI under ten minutes as the codebase grows.
Boundaries beat folders
A monorepo without package boundaries is a single app with extra path aliases. Clear packages — UI, domain, API clients, config — let TypeScript project references and build tools compute a real dependency graph.
Enforce dependency rules so apps cannot import each other's internals. Structure is what keeps incremental builds honest.
Project references and incremental typecheck
Enable project references and composite builds so unchanged packages are not rechecked from scratch. Pair with a workspace tool that understands the graph for task caching.
Watch for accidental any leaks and wide path mappings that defeat isolation. Fast typechecking depends on localised change sets.
CI under ten minutes
Cache dependencies and build outputs keyed by lockfile and package hashes. Run affected tests only when the graph says a package changed. Parallelise lint and typecheck where safe.
When CI creeps past your budget, profile which tasks invalidate most often — usually a root config or shared package with too many dependents.
Developer experience as a product
Local workflows should mirror CI enough to avoid surprise failures, but stay lighter. Generators for new packages prevent snowflake setups.
A monorepo that stays fast is curated continuously. Neglect turns it into a distributed monolith with worse tooling.
Alex Thompson
Backend Engineer
Backend engineer focused on performance, Postgres, and TypeScript platforms at scale.