Skip to content
Skillv1.0.0

turbopack

You are an expert in Turbopack, the Rust-based successor to Webpack built by Vercel. You help developers configure and optimize Turbopack for Next.js applications, achieving 10x faster cold starts and

by terminalskills(0) 0 installs
Free
Sign in to install

Free account. Installing gives you the manifest plus copy-paste snippets.

See reviews

About

Imported from terminalskills/skills (skills/turbopack/SKILL.md). Install upstream with npx skills add terminalskills/skills --skill turbopack. Copyright stays with the author (Apache-2.0).

Turbopack — Rust-Powered Bundler for Next.js

You are an expert in Turbopack, the Rust-based successor to Webpack built by Vercel. You help developers configure and optimize Turbopack for Next.js applications, achieving 10x faster cold starts and near-instant Hot Module Replacement (HMR) — replacing Webpack's JavaScript-based bundling with a parallelized, incremental Rust engine that scales to massive codebases.

Core Capabilities

Next.js Configuration

// next.config.ts — Enable Turbopack
import type { NextConfig } from "next";

const nextConfig: NextConfig = {
  // Turbopack is the default dev bundler in Next.js 15+
  // For production builds (experimental):
  experimental: {
    turbo: {
      // Custom webpack loaders (Turbopack compatible)
      rules: {
        "*.svg": {
          loaders: ["@svgr/webpack"],
          as: "*.js",
        },
        "*.md": {
          loaders: ["raw-loader"],
          as: "*.js",
        },
      },
      // Module resolution aliases
      resolveAlias: {
        "old-package": "new-package",
        canvas: false,                     // Exclude server-only module
      },
      // Custom resolve extensions
      resolveExtensions: [".tsx", ".ts", ".jsx", ".js", ".json", ".mdx"],
    },
  },
};

export default nextConfig;

Development

# Next.js 15+ uses Turbopack by default for dev
next dev                                  # Turbopack enabled automatically

# Explicit flags
next dev --turbopack                      # Force Turbopack
next build --turbopack                    # Experimental: production build

# Performance comparison (typical 10K module app):
# Webpack: cold start 8.2s, HMR 1.2s
# Turbopack: cold start 1.1s, HMR 12ms

Turbo Tasks (Incremental Engine)

# Turbopack's architecture:
# 1. Function-level caching — only recomputes changed functions
# 2. Incremental computation — HMR rebuilds only affected modules
# 3. Parallel execution — Rust threads process modules concurrently
# 4. Lazy compilation — only bundles requested routes

# Result: HMR time stays constant regardless of app size
# 1,000 modules: 12ms HMR
# 50,000 modules: 14ms HMR (nearly unchanged)

Installation

# Turbopack is built into Next.js 15+
npx create-next-app@latest                # Turbopack included
npm install next@latest                   # Upgrade existing project

Best Practices

  1. Default in Next.js 15+ — Turbopack is the default dev server; no configuration needed
  2. Loader compatibility — Most webpack loaders work via turbo.rules; SVGR, raw-loader, GraphQL loaders supported
  3. No webpack config — Turbopack doesn't use webpack.config.js; migrate custom loaders to turbo.rules
  4. Lazy compilation — Turbopack only compiles routes you visit; unused pages don't slow down dev server
  5. Persistent caching — Turbopack caches between restarts; second startup is nearly instant
  6. Module resolution — Use resolveAlias to redirect imports; replaces webpack's resolve.alias
  7. CSS support — CSS Modules, PostCSS, Tailwind CSS work out of the box; no additional config
  8. Gradual migration — Use Turbopack for dev, Webpack for production builds; switch to Turbopack builds when stable

Use it

Copy one of these into your project. Installing also returns the manifest and these snippets.

yaml
targets:
  - https://api.opensmartroute.ai/api/v1/registry/terminalskills-skills-turbopack/manifest   # or paste the manifest below

Manifest

An Open Capability Manifest: the router reads it to know what this does, what it costs and when to pick it.

terminalskills-skills-turbopack.ocm.jsonjson
{
  "ocm": "1",
  "id": "terminalskills-skills-turbopack",
  "kind": "skill",
  "name": "turbopack",
  "description": "You are an expert in Turbopack, the Rust-based successor to Webpack built by Vercel. You help developers configure and optimize Turbopack for Next.js applications, achieving 10x faster cold starts and near-instant Hot Module Replacement (HMR) — replacing Webpack's JavaScript-based bundling with a parallelized, incremental Rust engine that scales to massive codebases.",
  "publisher": "terminalskills",
  "version": "1.0.0",
  "capabilities": {
    "domains": [
      "coding"
    ],
    "tags": [
      "skill-md",
      "bundler",
      "rust",
      "next",
      "fast",
      "vite-alternative",
      "vercel",
      "hmr",
      "skills-sh"
    ],
    "languages": [
      "en"
    ]
  },
  "quality_prior": 0.6,
  "examples": [
    "You are an expert in Turbopack, the Rust-based successor to Webpack built by Vercel. You help developers configure and optimize Turbopack for Next.js applications, achieving 10x faster cold starts and near-instant Hot Module Replacement (HMR) — replacing Webpack's JavaScript-based bundling with a parallelized, incremental Rust engine that scales to massive codebases."
  ],
  "primary": false,
  "metadata": {
    "source": {
      "provider": "skills.sh",
      "repository": "https://github.com/terminalskills/skills",
      "path": "skills/turbopack/SKILL.md",
      "ref": "HEAD",
      "url": "https://github.com/terminalskills/skills/blob/HEAD/skills/turbopack/SKILL.md",
      "key": "terminalskills/skills/skills/turbopack/SKILL.md"
    },
    "license": "Apache-2.0"
  },
  "instructions": "# Turbopack — Rust-Powered Bundler for Next.js\n\nYou are an expert in Turbopack, the Rust-based successor to Webpack built by Vercel. You help developers configure and optimize Turbopack for Next.js applications, achieving 10x faster cold starts and near-instant Hot Module Replacement (HMR) — replacing Webpack's JavaScript-based bundling with a parallelized, incremental Rust engine that scales to massive codebases.\n\n## Core Capabilities\n\n### Next.js Configuration\n\n```typescript\n// next.config.ts — Enable Turbopack\nimport type { NextConfig } from \"next\";\n\nconst nextConfig: NextConfig = {\n  // Tu",
  "cost": {
    "context_tokens": 816
  }
}

Fetch it by URL: GET /api/v1/registry/terminalskills-skills-turbopack/manifest?version=1.0.0

Reviews

Star ratings from people who tried it. One review per account; edit yours any time.

No reviews yet. Install it, try it, and be the first to rate it.