
Turbopack
Configure Turbopack for Next.js 16 dev builds, faster HMR, and migrations off Webpack customizations.
Overview
Turbopack is an agent skill for the Build phase that guides Next.js 16 Turbopack configuration, HMR optimization, and Webpack-to-Turbopack migration debugging.
Install
npx skills add https://github.com/vercel-labs/vercel-plugin --skill turbopackWhat is this skill?
- Rust-powered bundler guidance aligned with Next.js 16 defaults and official Turbo/Next architecture docs
- Instant HMR patterns that avoid slowdown as the app grows
- Turbopack vs Webpack decision support and migration paths from experimental.turbopack to top-level config
- chainTo hooks load nextjs skill when Webpack or Turbopack blocks appear in next.config
- Triggers on next dev --turbo/--turbopack and next.config.* path patterns
- Default bundler in Next.js 16
- Official docs at turbo.build/pack and nextjs.org/architecture/turbopack
Adoption & trust: 332 installs on skills.sh; 187 GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
Your Next.js dev server feels slow or your next.config mixes Webpack plugins with Turbopack defaults and builds fail with unclear bundler errors.
Who is it for?
Solo builders on Next.js 16 who run next dev --turbopack and need correct top-level turbopack config without maintaining a parallel Webpack mental model.
Skip if: Teams that stay on Webpack-only custom loaders with no plan to migrate, or non-Next.js bundler stacks where Turbopack does not apply.
When should I use this skill?
Configuring the Next.js bundler, optimizing HMR, debugging build issues, or understanding Turbopack vs Webpack differences.
What do I get? / Deliverables
You get actionable Turbopack and next.config guidance, including when to invoke the nextjs skill for Webpack customization parity on Next.js 16.
- Corrected next.config / turbopack settings
- Migration notes from Webpack customizations to Turbopack top-level config
Recommended Skills
Journey fit
Bundler and dev-server tuning happen while you are actively building and iterating on a Next.js app, not during launch or growth work. Turbopack is the default frontend build pipeline for Next.js; placement on frontend reflects UI/app dev velocity rather than backend-only APIs.
How it compares
Expert procedural guidance for the Next.js bundler—not a separate MCP server or a generic JavaScript lint skill.
Common Questions / FAQ
Who is turbopack for?
Indie and solo developers building Next.js apps who want Turbopack as the default dev bundler and need help with HMR, config syntax, and build failures.
When should I use turbopack?
Use it in the Build phase while editing next.config, enabling next dev --turbo or --turbopack, speeding up the dev server, or debugging Turbopack vs Webpack differences before ship.
Is turbopack safe to install?
Review the Security Audits panel on this Prism page and the vercel-labs/vercel-plugin source before enabling agent filesystem access to your repo.
Workflow Chain
Then invoke: nextjs
SKILL.md
READMESKILL.md - Turbopack
# Turbopack You are an expert in Turbopack — the Rust-powered JavaScript/TypeScript bundler built by Vercel. It is the default bundler in Next.js 16. ## Key Features - **Instant HMR**: Hot Module Replacement that doesn't degrade with app size - **File System Caching (Stable)**: Dev server artifacts cached on disk between restarts — up to 14x faster startup on large projects. Enabled by default in Next.js 16.1+, no config needed. Build caching planned next. - **Multi-environment builds**: Browser, Server, Edge, SSR, React Server Components - **Native RSC support**: Built for React Server Components from the ground up - **TypeScript, JSX, CSS, CSS Modules, WebAssembly**: Out of the box - **Rust-powered**: Incremental computation engine for maximum performance ## Configuration (Next.js 16) In Next.js 16, Turbopack config is top-level (moved from `experimental.turbopack`): ```js // next.config.ts import type { NextConfig } from 'next' const nextConfig: NextConfig = { turbopack: { // Resolve aliases (like webpack resolve.alias) resolveAlias: { 'old-package': 'new-package', }, // Custom file extensions to resolve resolveExtensions: ['.ts', '.tsx', '.js', '.jsx', '.json'], }, } export default nextConfig ``` ## CSS and CSS Modules Handling Turbopack handles CSS natively without additional configuration. ### Global CSS Import global CSS in your root layout: ```tsx // app/layout.tsx import './globals.css' ``` ### CSS Modules CSS Modules work out of the box with `.module.css` files: ```tsx // components/Button.tsx import styles from './Button.module.css' export function Button({ children }) { return <button className={styles.primary}>{children}</button> } ``` ### PostCSS Turbopack reads your `postcss.config.js` automatically. Tailwind CSS v4 works with zero config: ```js // postcss.config.js module.exports = { plugins: { '@tailwindcss/postcss': {}, autoprefixer: {}, }, } ``` ### Sass / SCSS Install `sass` and import `.scss` files directly — Turbopack compiles them natively: ```bash npm install sass ``` ```tsx import styles from './Component.module.scss' ``` ### Common CSS pitfalls - **CSS ordering differs from webpack**: Turbopack may load CSS chunks in a different order. Avoid relying on source-order specificity across files — use more specific selectors or CSS Modules. - **`@import` in global CSS**: Use standard CSS `@import` — Turbopack resolves them, but circular imports cause build failures. - **CSS-in-JS libraries**: `styled-components` and `emotion` work but require their SWC plugins configured under `compiler` in next.config. ## Tree Shaking Turbopack performs tree shaking at the module level in production builds. Key behaviors