🌐 Web Development

Turbopack

Turbopack

Vercel's Rust-based bundler. Successor to Webpack. Supported in Next.js 13+.

📖 Detailed Explanation

Turbopack is a next-generation JavaScript/TypeScript bundler developed by Vercel in Rust. As the spiritual successor to Webpack, it is designed to achieve millisecond-level incremental compilation even in large-scale projects. It has been adopted as the default bundler in Next.js 15 and later.

The reason Turbopack is fast is Rust's low-level performance and its incremental computation engine. By using function-level caching that recalculates only the affected parts when a file changes, it maintains a consistent update speed regardless of project size.

Turbopack addresses Webpack's architectural limitations (JavaScript-based, recalculating the entire bundle). According to Vercel benchmarks, it shows cold starts 10 times faster than Vite and 700 times faster than Webpack. However, these figures are based on large-scale projects, and the difference is smaller in small-scale ones.

In practice, Turbopack is automatically enabled in the Next.js development server. Production builds still use Webpack, but Vercel is gradually expanding Turbopack support. Because HMR (Hot Module Replacement) is nearly instantaneous, productivity improves especially in large monorepos.

💻 Code Example

# Next.js에서 Turbopack 활성화

# 개발 서버 (Next.js 13+)
next dev --turbo

# package.json scripts 설정
{
  "scripts": {
    "dev": "next dev --turbo",
    "build": "next build",
    "start": "next start"
  }
}

# next.config.js - Turbopack 설정 (experimental)
/** @type {import('next').NextConfig} */
const nextConfig = {
  experimental: {
    turbo: {
      rules: {
        // 커스텀 로더 설정
        '*.svg': {
          loaders: ['@svgr/webpack'],
          as: '*.js',
        },
      },
      resolveAlias: {
        // 모듈 별칭 설정
        underscore: 'lodash',
      },
    },
  },
}

module.exports = nextConfig

🗣️ Say It Like This in Practice

💬 In a Team Meeting
"After upgrading to Next.js 15 and enabling Turbopack, HMR became noticeably faster. Previously I had to wait 2-3 seconds after saving, but now changes are reflected almost immediately. However, it is still not compatible with some Webpack plugins, so we need to check."
💬 In an Interview
"Turbopack is a bundler written in Rust that recompiles only the changed parts through incremental computation. Unlike Webpack, it does not recalculate the entire module graph, so the key point is that build time does not increase linearly even as the project grows."
💬 In a Technical Discussion
"There's a Turbopack vs Vite debate, and both have pros and cons. Vite is based on esbuild + Rollup and has a mature ecosystem, while Turbopack is optimized for Next.js. For a team like ours that uses Next.js, Turbopack is the right fit, and if you use another framework, Vite may be better."

Take a mock interview on this topic → WIA SOOM AI Interview · Start for free

⚠️ Common Mistakes & Cautions

❌
Expecting all Webpack plugins to work

Turbopack has a different API from Webpack. Complex Webpack plugins may not be supported yet, so you need to check compatibility before migrating.

❌
Attempting to use Turbopack for production builds

As of 2024, Turbopack is used only in the development server (next dev --turbo). Production builds (next build) still use Webpack.

✅
The right approach

Test Turbopack in your development environment first, and if there are problems, you can remove the --turbo flag to fall back to Webpack. Adopt it gradually.

🔗 Related Terms

📚 Learn More