Skip to main content
Turbopack is a Rust-based incremental bundler integrated into Next.js. It is the default bundler for both next dev and next build.

Why Turbopack is fast

Turbopack’s performance comes from two core design principles:

Demand-driven evaluation

Turbopack only processes the modules your application actually requests. On first load, only the modules needed to render the current page are compiled. Unvisited routes are compiled lazily.

Persistent caching

Build artifacts are cached to disk between runs. On subsequent starts, only modules that have changed (or depend on changed modules) are recompiled. Cold starts after the first build are significantly faster.
Internally, Turbopack models the build as a reactive computation graph. Each file and transform is a node; edges represent dependencies. When a file changes, only the affected subgraph is invalidated and recomputed.

Repository structure

Turbopack lives in the turbopack/ directory of the Next.js monorepo, managed as a git subtree:
turbopack/
├── crates/         # Rust crates (core bundler logic)
├── packages/       # JavaScript packages
├── scripts/        # Build and utility scripts
└── xtask/          # Cargo xtask runner

How Turbopack differs from Webpack

WebpackTurbopack
LanguageJavaScriptRust
EvaluationEager (full graph)Demand-driven (on-request)
CachingIn-memory onlyIn-memory + persistent disk cache
ParallelismLimited (single-threaded by default)Native multi-threading
Plugin APIMature, extensiveGrowing — not fully compatible with Webpack plugins
Default sinceNext.js v1Next.js v15 (dev), v15 (build)
Turbopack does not support the Webpack plugin API. If you rely on custom Webpack plugins, you will need to use Webpack explicitly.

Forcing Webpack

If you need to use Webpack instead of Turbopack, pass the --webpack flag:
next dev --webpack
There is no --no-turbopack flag. Use --webpack to opt out.

Configuring Turbopack in Next.js

You can customize Turbopack behavior in next.config.js under the turbopack key:
module.exports = {
  turbopack: {
    // Add custom module resolution rules
    resolveAlias: {
      'underscore': 'lodash',
    },
    // Override file extensions for module resolution
    resolveExtensions: [
      '.mdx',
      '.tsx',
      '.ts',
      '.jsx',
      '.js',
      '.mjs',
      '.json',
    ],
  },
}
See the Turbopack configuration reference for the full list of options.

Analyzing bundles with Turbopack

Turbopack includes a build analysis tool available in the .next/analyze/ output after a production build. You can inspect it with:
next build --turbopack
The build directory also includes turbopack-analyze/ helpers for programmatic inspection of the bundle graph.

Current status

Turbopack is stable and the default in Next.js 15. Ongoing work focuses on:
  • Expanding coverage of Webpack plugin APIs
  • Improving persistent cache invalidation accuracy
  • Reducing memory usage for very large applications
When switching branches or pulling significant changes, delete stale native binaries if Turbopack produces unexpected errors: remove packages/next-swc/native/*.node and run pnpm install to fetch the npm-published binary.

Build docs developers (and LLMs) love