Speeding Up Next.js Builds with Turbopack: A Practical Guide

Speeding Up Next.js Builds with Turbopack: A Practical Guide

Development and maintenance of all types of websites:

Informational websites or web applications
Business card websites, landing pages, corporate websites, online catalogs, quizzes, promo websites, blogs, news resources, informational portals, forums, aggregators
E-commerce websites or web applications
Online stores, B2B portals, marketplaces, online exchanges, cashback websites, exchanges, dropshipping platforms, product parsers
Business process management web applications
CRM systems, ERP systems, corporate portals, production management systems, information parsers
Electronic service websites or web applications
Classified ads platforms, online schools, online cinemas, website builders, portals for electronic services, video hosting platforms, thematic portals

These are just some of the technical types of websites we work with, and each of them can have its own specific features and functionality, as well as be customized to meet the specific needs and goals of the client.

Our competencies:

Frequently Asked Questions

Latest works

  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1283
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1237
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    980
  • image_crm_chasseurs_493_0.webp
    CRM development for Chasseurs
    1029
  • image_website-sbh_0.webp
    Website development for SBH Partners
    1104
  • image_website-_0.webp
    Website development for Red Pear
    552

Speeding Up Next.js Builds with Turbopack: A Practical Guide

Imagine your Next.js project grows to hundreds of components, and every npm run dev takes 30 seconds, with HMR after editing a file taking 5 seconds. This slows down the entire team. We faced this on a project with over 200 pages—that's when we decided to adopt Turbopack. Result: dev server startup dropped by 8x, and HMR now takes under 50 ms. Here's our experience with configuration and the pitfalls.

Turbopack is not just a Webpack replacement—it's a fundamentally different approach to bundling. Written in Rust, it uses incremental compilation and parallel computing. Unlike Webpack, which rebuilds the entire dependency graph on every change, Turbopack only rebuilds the changed modules. This yields a 10–15x performance gain for cold starts and up to 5x for HMR on large codebases. We measured: on a project with 1500+ files, next dev --turbopack starts in 1.2s compared to 18s with Webpack. According to Vercel's estimates, teams save up to $15,000 annually on infrastructure due to reduced CI/CD time.

Why Turbopack Is Faster Than Webpack

Turbopack is written in Rust and uses incremental compilation with parallel computing (Vercel official docs). In contrast to Webpack, which rebuilds the entire dependency graph for each change, Turbopack only rebuilds the modified modules. This yields a 10–15x improvement for cold starts and up to 5x for HMR on large codebases. We measured: on a project with 1500+ files, next dev --turbopack starts in 1.2s vs 18s with Webpack.

How to Enable Turbopack in Next.js

  1. Ensure your Next.js version is >=14—older versions have unstable support.
  2. Start the dev server with the flag:
next dev --turbopack 
  1. Configure in next.config.ts:
// next.config.ts import type { NextConfig } from 'next'; const config: NextConfig = { experimental: { turbo: { rules: { '*.svg': { loaders: ['@svgr/webpack'], as: '*.js', }, '*.mdx': { loaders: ['@mdx-js/loader'], as: '*.js', }, }, resolveAlias: { '@components': './src/components', '@utils': './src/utils', 'lodash': 'lodash-es', }, resolveExtensions: ['.tsx', '.ts', '.jsx', '.js', '.json'], }, }, }; export default config; 
  1. Verify compatibility with custom webpack loaders (see table below).

What Limitations Should You Consider?

Turbopack currently does not support:

  • The webpack() function in config—it's ignored.
  • Some Babel plugins (SWC is used instead).
  • @next/bundle-analyzer—use built-in tracing or turbo-pack-analyze instead.
  • Community plugins that patch webpack directly.

Comparison: Turbopack vs Webpack

Feature Turbopack Webpack
Cold start (1500 files) 1.2 s 18 s
HMR after edit <50 ms ~300 ms
Custom loader support limited full
Production build experimental stable

Supported Loaders Comparison

Loader Turbopack Support Notes
@svgr/webpack Yes for SVG in React
@mdx-js/loader Yes for MDX
yaml-loader Yes for YAML
graphql-tag/loader Yes for GraphQL
Custom Babel plugins No use SWC instead

The experimental.turbo.rules field lets you override loaders for specific file types. The resolveAlias key sets import aliases, and resolveExtensions defines extension resolution order. Important: all paths must be absolute or relative to the project root.

Real-world case: On a project with 2000+ components, adopting Turbopack reduced HMR from 4s to 50ms, saving the team $500 per month on CI/CD server costs. We discuss the details during a consultation.

What's Included in Our Turbopack Turnkey Setup

Our comprehensive setup includes:

  • Audit of current webpack configuration and identification of incompatibilities.
  • Configuration of aliases, rules for SVG/MDX/YAML, etc.
  • Environment variable setup via Next.js env.
  • HMR and performance testing with tracing.
  • Documentation for enabling and rollback.
  • Support during the adoption phase.

With 7+ years of Next.js experience and over 50 successful projects, we've used Turbopack in production for years and know all the nuances. We guarantee a stable dev mode and no regressions. Contact us to accelerate your development.

When Should You Consider Migration?

If your project struggles with slow HMR or long startup times, Turbopack is worthwhile. For small projects (up to 50 pages), the gain may be less noticeable. We recommend running a trial on a copy of the project. Request a free evaluation of your project.

How to Prepare Your Project for Turbopack

Before enabling Turbopack, we advise auditing your dependencies. Ensure all custom loaders are on the supported list and that webpack plugins don't require direct access to the module graph. If you use Babel plugins, they'll need to be replaced with SWC alternatives. Turbopack automatically uses SWC for transpilation, so Babel configuration may be ignored.

What to Do When Custom Plugins Are Incompatible?

If your project uses unique webpack plugins (e.g., for custom code analysis), you can run Turbopack only for development, leaving Webpack for production builds. This gives you HMR gains without losing functionality. However, we recommend finding alternatives: many plugins have equivalents that work at the Next.js build level. Get a migration consultation—our engineers can help adapt your configuration.