turbopack

Configure and troubleshoot Turbopack bundling, HMR, and webpack migration in Next.js projects.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Developers working with Turbopack in Next.js often struggle with migrating webpack configurations, debugging build failures, and understanding bundler differences. This Skill provides expert guidance for configuring, optimizing, and troubleshooting Turbopack. ## Core Features & Use Cases - Configuration Guidance: Set up top-level turbopack config in Next.js 16, including resolve aliases, custom rules, and loader replacements. - Webpack Migration: Map webpack loaders to Turbopack equivalents and migrate experimental.turbopack to the new top-level syntax. - Build Diagnostics: Diagnose production build failures, oversized bundles, CSS ordering issues, and environment boundary errors. - Use Case: When a Next.js build fails after switching to Turbopack because of a custom webpack SVG loader, use this Skill to configure turbopack.rules with @svgr/webpack and resolve the error. ## Quick Start Ask the AI to help migrate your webpack configuration in next.config.ts to Turbopack's top-level config format 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 migrate webpack config to Turbopack in Next.js?

Move webpack customizations to the top-level `turbopack` key in next.config.ts. Use `turbopack.resolveAlias` for resolve aliases and `turbopack.rules` for custom loaders like @svgr/webpack. Remove any `webpack()` function since Turbopack ignores it.

What is the difference between Turbopack and webpack?

Turbopack is written in Rust with constant-time HMR and native React Server Components support, while webpack is JavaScript-based with a larger loader ecosystem. Turbopack is the default bundler in Next.js 16, but webpack remains supported via `bundler: 'webpack'`.

Does Turbopack support Sass and CSS Modules?

Yes, Turbopack handles CSS, CSS Modules, and Sass natively without loaders. Install the `sass` package and import `.scss` files directly. PostCSS config files are read automatically, and Tailwind CSS v4 works with zero configuration.

Why is my Next.js build failing with Turbopack?

Common causes include leftover `webpack()` config functions, invalid `turbopack.rules` loaders, Node.js built-ins imported in client or edge bundles, and missing `turbopack.resolveAlias` entries. Check each of these and compare against a webpack build to isolate the issue.

When should I use webpack instead of Turbopack?

Use webpack when you rely on custom loaders with no Turbopack equivalent, complex plugins like ModuleFederationPlugin, or unsupported features like custom externals functions. Opt out by setting `bundler: 'webpack'` in next.config.ts.

How do I profile Turbopack build performance?

Run builds or dev server with `NEXT_TURBOPACK_TRACING=1` to generate a trace.json file. Open it in chrome://tracing or Perfetto to inspect module-level timing, slow transforms, and cache misses.