Cut frontend build times 10× and migrated 30k lines from JavaScript to TypeScript

· Performance · esbuild · TypeScript · DevOps · Frontend

Replaced Webpack with esbuild and led the full migration of a production frontend from JS to strict TypeScript — without stopping shipping.

Documatrix logo
Client: Documatrix

Project overview

Documatrix

Software engineering internship at Documatrix (today neeyo). The brief was infrastructure: the codebase had outgrown its build pipeline, and a JavaScript monolith was producing runtime bugs that should have been caught at compile time. I led both fixes.

The same instinct that fixes a slow build fixes a slow ML pipeline — strict types, fast feedback, ruthless dependency choice.


The challenge

As the startup’s codebase grew, the existing build system (based on Webpack) had become a significant bottleneck:


What I did

1. Build system — replaced Webpack with esbuild

esbuild is written in Go and leverages parallelism that JavaScript bundlers can’t match.

Result: Build times dropped from ~120 seconds to under 10 seconds — a consistent 10× boost.

2. Full TypeScript migration

Transitioned from a dynamic JavaScript codebase to a strictly typed TypeScript ecosystem, incrementally, without halting feature work.


Impact

MetricLegacy (JS / Webpack)Optimized (TS / esbuild)Improvement
Local cold start135 s12 s11×
HMR (update speed)4–6 s< 0.5 sInstant
CI pipeline build9 min 30 s2 min 15 s~75% faster
Code reliabilityFrequent runtime bugsCaught at compile timeSignificant

Stack


What this proves for AI work

Modern ML codebases drift faster than web ones. The same instincts — strict types, fast feedback, ruthless dependency choice — keep them sane. Eval pipelines, agent harnesses, and on-device inference toolchains all live in the same kind of infrastructure that this migration replaced. When AI work is described as “engineering,” this is part of what that means.