Skip to main content
Article·blog.railway.com
web-developmentdeploymentinfrastructuredevopsperformancenext.js

We moved Railway's frontend off Next.js. Builds went from 10+ mins to under 2

Address excessively long frontend build times by critically evaluating your current framework and build processes. Migrating to a more performant stack can drastically reduce build durations, significantly boosting developer productivity and deployment speed.

advancedWeeks to Months5 steps
The play
  1. Measure Current Build Performance
    Accurately track your frontend application's build duration using `time` commands or CI/CD pipeline logs. Establish a clear baseline for current performance.
  2. Analyze Framework & Tooling Impact
    Investigate if your current frontend framework (e.g., Next.js, Angular, React with Webpack) or build tooling is a primary contributor to slow build times and performance bottlenecks.
  3. Research Alternative Solutions
    Explore alternative frameworks, bundlers (e.g., Vite, Turbopack), or architectural patterns (e.g., micro-frontends, static site generation) known for faster build times and improved developer experience.
  4. Develop a Migration Strategy
    Plan the technical steps, resource allocation, and timeline required to strategically transition your frontend to a more performant stack. Consider incremental migration where possible.
  5. Execute & Validate Migration
    Implement the chosen solution, conduct thorough testing to ensure functionality, and rigorously measure the new build times to confirm the expected performance improvements.
Starter code
time npm run build
Source
We moved Railway's frontend off Next.js. Builds went from 10+ mins to under 2 — Action Pack