nextjs-turbopack
affaan-m/everything-claude-code
Next.js 16+ incremental bundler with Rust-powered Turbopack for faster dev startup and HMR.
What is nextjs-turbopack?
Turbopack is the default bundler for Next.js 16+ local development, offering incremental bundling and file-system caching for significantly faster cold starts and hot module reloads. Use it for day-to-day development unless you hit a Turbopack bug or need a webpack-only plugin.
- Incremental bundling with file-system caching for faster dev restarts (5–14x speedup on large projects)
- Default bundler for `next dev` in Next.js 16+; no extra config needed for basic use
- Hot Module Reload (HMR) optimized for large applications
- Experimental Bundle Analyzer (Next.js 16.1+) to inspect and optimize output
- Fallback to webpack via `--webpack` flag if needed for compatibility
How to install nextjs-turbopack
npx skills add https://github.com/affaan-m/everything-claude-code --skill nextjs-turbopack- Next.js 16 or later installed
- Node.js and npm/yarn/pnpm
How to use nextjs-turbopack
- 1.Run `next dev` to start local development with Turbopack (default)
- 2.Monitor dev startup time and HMR speed; if slow, verify Turbopack is enabled and cache is not being cleared
- 3.Use the Bundle Analyzer (see Next.js docs for your version) to inspect output and identify optimization opportunities
- 4.If you hit a Turbopack bug, disable with `--webpack` flag and report the issue
- 5.For production builds, run `next build` and check official Next.js docs for your version's bundler behavior
Use cases
- Speed up local development startup and hot updates in large Next.js applications
- Diagnose slow dev startup or HMR performance issues
- Inspect bundle composition and identify heavy dependencies using Bundle Analyzer
- Migrate from webpack to Turbopack for faster iteration cycles
- Optimize production bundles by analyzing code-splitting opportunities
- Next.js 16+ developers
- Full-stack engineers optimizing build performance
- Teams with large codebases experiencing slow dev startup
- Developers debugging bundle size and dependency issues
nextjs-turbopack FAQ
Yes. `next dev` uses Turbopack by default in Next.js 16+. You can disable it with the `--webpack` flag if needed for compatibility.
Next.js 16 uses `proxy.ts` at the project root, replacing the older `middleware.ts` convention. Do not rename it to `middleware.ts` as that will break middleware execution.
Turbopack can provide 5–14x speedup on large projects due to incremental bundling and file-system caching, though results vary by project size and complexity.
The file-system cache is typically stored under `.next` and is automatically managed; no extra configuration is needed for basic use.
Production build behavior depends on your Next.js version. Check the official Next.js docs for your release to confirm whether `next build` uses Turbopack or webpack.
Full instructions (SKILL.md)
Source of truth, from affaan-m/everything-claude-code.
name: nextjs-turbopack description: Next.js 16+ and Turbopack — incremental bundling, FS caching, dev speed, and when to use Turbopack vs webpack. metadata: origin: ECC
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-turbopackdepending 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 devruns 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.tsat the project root - Pre-Next.js 16: use
middleware.tsat 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.
Related skills
More from affaan-m/everything-claude-code and the wider catalog.
security-review
Security checklist and patterns for authentication, input validation, secrets, and sensitive features.
golang-patterns
Idiomatic Go patterns, best practices, and conventions for building robust, efficient, and maintainable applications.
coding-standards
Baseline coding conventions for naming, readability, immutability, and quality across projects.
frontend-patterns
React and Next.js patterns for components, state management, performance, and modern frontend practices.
backend-patterns
REST/GraphQL API design, database optimization, and server-side patterns for Node.js, Express, and Next.js.
golang-testing
Go testing patterns: table-driven tests, subtests, benchmarks, fuzzing, and TDD methodology.