Catalog
affaan-m/nextjs-turbopack

affaan-m

nextjs-turbopack

Next.js 16+ and Turbopack guidance — incremental Rust bundling, file-system caching, faster dev startup and HMR, Turbopack vs webpack tradeoffs, and the middleware.ts to proxy.ts filename change. Use when developing or debugging Next.js 16+ apps, diagnosing slow dev startup or hot reload, choosing between bundlers, or reviewing middleware/proxy file naming.

NewUpdated Sep 27, 2026

Next.js and Turbopack

Next.js 16+ uses Turbopack by default for local development: an incremental bundler written in Rust that significantly speeds up dev startup and hot updates.

When to Use

  • Turbopack (default dev): Use for day-to-day development. Faster cold start and HMR, especially in large apps.
  • Webpack (legacy dev): Use only if you hit a Turbopack bug or rely on a webpack-only plugin in dev. Disable with --webpack (or --no-turbopack depending on your Next.js version; check the docs for your release).
  • Production: Production build behavior (next build) may use Turbopack or webpack depending on Next.js version; check the official Next.js docs for your version.

Use when: developing or debugging Next.js 16+ apps, diagnosing slow dev startup or HMR, or optimizing production bundles.

How It Works

  • Turbopack: Incremental bundler for Next.js dev. Uses file-system caching so restarts are much faster (e.g. 5–14x on large projects).
  • Default in dev: From Next.js 16, next dev runs with Turbopack unless disabled.
  • File-system caching: Restarts reuse previous work; cache is typically under .next; no extra config needed for basic use.
  • Bundle Analyzer (Next.js 16.1+): Experimental Bundle Analyzer to inspect output and find heavy dependencies; enable via config or experimental flag (see Next.js docs for your version).

Examples

Commands

next dev
next build
next start

Usage

Run next dev for local development with Turbopack. Use the Bundle Analyzer (see Next.js docs) to optimize code-splitting and trim large dependencies. Prefer App Router and server components where possible.

Middleware File Naming

Next.js 16 introduced proxy.ts as the middleware filename, replacing the older middleware.ts convention:

  • Next.js 16+: use proxy.ts at the project root
  • Pre-Next.js 16: use middleware.ts at the project root

The filename change is tied to the Next.js version, not to which bundler (Turbopack or webpack) is in use. Always check the official docs for the version you are reviewing.

Do not flag proxy.ts as a misnamed or missing middleware file in Next.js 16 projects. The file is correct and intentional. Suggesting a rename to middleware.ts will break middleware execution.

Reference: Next.js proxy docs

Best Practices

  • Stay on a recent Next.js 16.x for stable Turbopack and caching behavior.
  • If dev is slow, ensure you're on Turbopack (default) and that the cache isn't being cleared unnecessarily.
  • For production bundle size issues, use the official Next.js bundle analysis tooling for your version.
Files1
1 files · 1.0 KB

Select a file to preview

Overall Score

82/100

Grade

B

Good

Grades are signals, not a certification. Always review a skill yourself before use.

Safety

88

Quality

82

Clarity

86

Completeness

72

Summary

A guidance skill for Next.js 16+ development with Turbopack, covering incremental Rust bundling, file-system caching, dev startup optimization, Turbopack vs webpack tradeoffs, and the middleware.ts-to-proxy.ts filename migration. The skill helps developers diagnose slow dev performance, choose appropriate bundlers, and understand version-specific configuration.

Detected Capabilities

documentation referencebundler configuration guidanceversion-specific behavior reference

Trigger Keywords

Phrases that agents use to match this skill to user intent.

turbopack slow startupnext.js middleware migrationdev hot reload lagnextjs bundler choiceturbopack vs webpackproxy.ts configuration

Referenced Domains

External domains referenced in skill content, detected by static analysis.

nextjs.org

Use Cases

  • Debug slow Next.js dev startup by switching to/from Turbopack
  • Diagnose hot module reload (HMR) performance issues
  • Understand Turbopack vs webpack tradeoffs for project bundler selection
  • Migrate middleware configuration from middleware.ts to proxy.ts in Next.js 16+
  • Optimize production bundle size using Next.js Bundle Analyzer
  • Troubleshoot cache-related dev issues in large Next.js projects

Quality Notes

  • Well-scoped to a specific technology domain (Next.js 16+ and Turbopack)
  • Clear decision logic: when to use Turbopack vs webpack vs production build
  • Explicitly documents version-specific behavior (middleware.ts vs proxy.ts naming) with guidance on how to avoid breaking changes
  • Addresses the most common pain point (slow dev startup) with clear guidance on how to diagnose and resolve
  • Best practices section includes practical actionable advice (stay on recent 16.x, cache preservation, bundler selection)
  • Good use of formatting with clear sections and command examples
  • References official Next.js docs appropriately rather than replicating full documentation
  • Addresses a common misconception (proxy.ts not being a 'correct' middleware file) with explicit guidance to prevent false-positive code reviews
Model: claude-haiku-4-5-20251001Analyzed: Sep 27, 2026

Reviews

Add this skill to your library to leave a review.

No reviews yet

Be the first to share your experience.

Version History

  1. v2.0

    Contract changed: description

    ✦ AIExpands activation scope: adds guidance on middleware.ts to proxy.ts filename change, dev startup/HMR optimization, and bundler tradeoffs.

    triggering2026-09-27

    LATEST
  2. v1.2

    Content updated

    ✦ AIAdds guidance on Next.js 16 middleware filename change: proxy.ts replaces middleware.ts with version-specific instructions.

    2026-07-14

    View This Version
  3. v1.1

    Content updated

    ✦ AIAdds LICENSE file.

    2026-04-20

    View This Version
  4. v1.0

    2026-04-12

    View This VersionInitial version

Use affaan-m/nextjs-turbopack in your dev environment

Command Palette

Search for a command to run...