turbopack

Configure and troubleshoot the Turbopack bundler in Next.js projects.

Updated Sep 5, 2026
One-click install
npx skills add https://github.com/dsgalkar/dnyaneshwar_portfolio --skill turbopack-dsgalkar
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: turbopack
Source: https://github.com/dsgalkar/dnyaneshwar_portfolio/tree/main/.agents/plugins/vercel/skills/turbopack
Command: npx skills add https://github.com/dsgalkar/dnyaneshwar_portfolio --skill turbopack-dsgalkar

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Developers migrating to or working with Turbopack in Next.js 16 face configuration changes, webpack loader incompatibilities, CSS ordering differences, and build failures that are hard to diagnose without bundler-specific expertise. ## Core Features & Use Cases - Configuration Guidance: Set up top-level turbopack config in next.config, including resolveAlias, resolveExtensions, and custom rules for loaders like @svgr/webpack. - Webpack Migration: Map common webpack loaders (css-loader, sass-loader, file-loader, raw-loader) to Turbopack built-ins or equivalents, and know when to fall back to webpack. - Build Diagnostics: Troubleshoot production build failures, oversized bundles, environment boundary errors, and profile HMR or builds with NEXT_TURBOPACK_TRACING. - Use Case: You upgrade to Next.js 16 and your build breaks because of an old experimental.turbopack block and a custom webpack SVG loader. This Skill walks you through moving config to top-level turbopack and rewriting the loader as a turbopack.rules entry. ## Quick Start Ask the assistant to migrate your next.config webpack customizations to Turbopack top-level config for Next.js 16.

Frequently Asked Questions about turbopack

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I configure Turbopack in Next.js 16?

In Next.js 16, Turbopack config lives at the top level of next.config as `turbopack`, moved out of `experimental.turbopack`. Use it to set resolveAlias, resolveExtensions, and custom rules for loaders.

How to migrate webpack loaders to Turbopack?

Many webpack loaders have built-in Turbopack equivalents: css-loader, sass-loader, postcss-loader, and file-loader need no replacement. For others like @svgr/webpack, define entries under `turbopack.rules` in next.config.

Turbopack vs webpack: which should I use in Next.js?

Turbopack is the default bundler in Next.js 16, offering constant-time HMR and native RSC support. Choose webpack only when you depend on loaders or plugins with no Turbopack equivalent, such as ModuleFederationPlugin, by setting `bundler: 'webpack'`.

Does Turbopack support Sass and Tailwind CSS?

Yes. Turbopack compiles .scss files natively once you install the `sass` package, and it reads postcss.config.js automatically, so Tailwind CSS v4 works with zero extra configuration.

Why does my Turbopack build fail after migrating from webpack?

Common causes include leftover `webpack()` functions in next.config, missing resolveAlias entries, invalid loaders in turbopack.rules, or Node.js built-ins like `fs` imported in client or edge bundles. Remove webpack config and check environment boundaries first.

How do I profile slow Turbopack builds or HMR?

Run `NEXT_TURBOPACK_TRACING=1 next dev` or `next build` to write a trace.json file, then open it in chrome://tracing or Perfetto. Look for long-running transforms, large module graphs, and cache misses.