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
- Measure Current Build PerformanceAccurately track your frontend application's build duration using `time` commands or CI/CD pipeline logs. Establish a clear baseline for current performance.
- Analyze Framework & Tooling ImpactInvestigate 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.
- Research Alternative SolutionsExplore 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.
- Develop a Migration StrategyPlan the technical steps, resource allocation, and timeline required to strategically transition your frontend to a more performant stack. Consider incremental migration where possible.
- Execute & Validate MigrationImplement 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