All articles

How One Company Cut Frontend Builds From 10 Minutes to Under Two Using a Custom Framework

A deep dive into Railway’s bold decision to replace Next.js with a lightweight custom stack, trimming build times from 10+ minutes to under two. Discover the technical steps, performance gains, and business impact that can inspire your own modernization.

QovaTech4 min read
How One Company Cut Frontend Builds From 10 Minutes to Under Two Using a Custom Framework

The 10‑Minute Build Problem

Every modern web team has that one file‑watcher that hangs on the brink of the build timeout. I’ve seen the same Slack thread pop up in dozens of companies: “Our front‑end takes 10‑12 minutes to compile; we’re losing two hours every sprint.”

In 2026, with the proliferation of server‑side rendering (SSR) and static site generation (SSG), build times have become a soft‑budget line item. A 10‑minute build means a developer can’t spin up a fresh branch until the previous one finishes, and a two‑hour cycle can turn a fast‑moving product into a stagnant monolith.

Railway, a rapid‑deployment platform for full‑stack apps, faced this exact pain point. Their team was using Next.js 13, the industry‑standard for hybrid rendering. However, the company’s traffic spiked to 200k daily pageviews, pushing their build pipeline to the brink.

Why Next.js Was a Bottleneck

Next.js offers a powerful feature set: automatic code splitting, image optimization, and a unified API layer. Yet, those same features inflate the dependency graph and increase webpack (or now the new Mitosis) bundle size.

Key pain points for Railway were:

  • Large dependency tree – 360 npm packages, 1.2 GB of node_modules.
  • Slow incremental builds – even with the new esbuild compiler, each change triggered a full rebuild of the production bundle.
  • Heavy SSR cache – every request triggered a serverless function that pulled from a 500 MB bundle, causing cold‑start latency.

The result: a 12‑minute build pipeline that was eating into developer productivity and delaying feature releases.

The Decision to Build a Custom Framework

Instead of trying to fit Next.js into a lean build pipeline, Railway’s engineering team chose to write a custom framework around a minimal set of features:

  1. Static file server – serve pre‑rendered HTML from a CDN.
  2. Edge‑first rendering – leverage Cloudflare Workers to run SSR on the edge.
  3. Incremental static regeneration (ISR) – rebuild only the pages that changed.
  4. Zero‑config bundler – replace webpack with esbuild‑based Rollup for a 10× faster compile.
  5. TypeScript first – eliminate runtime type checks to save 200 ms per request.

They also introduced a mono‑repo with Turborepo, allowing shared utilities and data models to be compiled once and reused across services.

Build Time Reduction in Numbers

After the migration, the team measured the following:

  • Build duration – dropped from 12 minutes to 1.8 minutes (a 85% reduction).
  • Bundle size – shrank from 1.2 GB to 350 MB.
  • Cold start latency – improved from 600 ms to 120 ms on Cloudflare Workers.
  • Developer velocity – the average feature cycle time shrank from 4 days to 2.5 days.

These numbers are not just vanity metrics. A 1‑minute reduction in build time translates to an extra 1.2 hours of coding per week for a team of five, or roughly $12,000 in annual savings at an average developer rate of $120 k/yr.

Practical Steps for Your Team

If you’re stuck in a similar build‑time quagmire, consider the following roadmap:

  1. Audit your dependency graph – remove unused packages and replace heavy libraries with lighter alternatives.
  2. Adopt a fast bundler – try esbuild or Vite for first‑class incremental builds.
  3. Move SSR to the edge – Cloudflare Workers, Fastly Compute@Edge, or Netlify Edge Functions can cut cold‑start latency.
  4. Implement ISR – rebuild only the changed pages rather than the entire site on each deploy.
  5. Use a mono‑repo – centralize shared code and run a single build pipeline with Turborepo or Nx.

The key is to strip the framework down to the essentials required for your product, then add only the features that add measurable value.

Business Impact Beyond the Numbers

Shorter builds aren’t just a productivity win; they unlock new business opportunities:

  • Faster time‑to‑market – iterate on user feedback in real time.
  • Higher uptime – fewer failed deployments mean a more reliable user experience.
  • Better scalability – edge‑first rendering distributes load globally, reducing server costs.
  • Competitive differentiation – a snappy, reliable front‑end can be a selling point in the crowded SaaS market.

Railway’s case is a clear signal: when your front‑end build pipeline becomes a bottleneck, it’s time to re‑architect, not just optimize.

Ready to Reimagine Your Front‑End?**

Ready to slash your build times and boost developer velocity? Contact QovaTech for a free consultation. We'll help you build a lean, edge‑first stack that delivers instant performance and scalable growth.