nextjs-turbopack
affaan-m/ecc
Next.js 16+ incremental bundler with Rust-powered Turbopack for 5–14x 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 reloading. Use it for day-to-day development unless you hit a Turbopack bug or rely on a webpack-only plugin.
- Incremental bundling with file-system caching for 5–14x faster restarts on large projects
- Default dev bundler in Next.js 16+ with faster cold start and HMR than webpack
- Automatic cache reuse under `.next` directory with no extra configuration needed
- Bundle Analyzer (Next.js 16.1+) to inspect output and identify heavy dependencies
- Fallback to webpack via `--webpack` flag if Turbopack bugs or plugin incompatibilities arise
How to install nextjs-turbopack
npx skills add null --skill nextjs-turbopack- Next.js 16 or later installed
- Node.js and npm/yarn/pnpm for running Next.js commands
How to use nextjs-turbopack
- 1.Run `next dev` to start local development with Turbopack enabled by default
- 2.Monitor dev startup time and HMR speed; Turbopack should be significantly faster than webpack
- 3.If you encounter Turbopack bugs, disable it with `next dev --webpack` and report the issue
- 4.Use the Bundle Analyzer (Next.js 16.1+) to inspect bundle size and identify optimization opportunities
- 5.For Next.js 16+ projects, use `proxy.ts` at the project root for middleware; do not use `middleware.ts`
Use cases
- Speed up local development workflow in large Next.js 16+ applications
- Diagnose and fix slow dev startup or hot module reloading performance
- Optimize production bundles using the experimental Bundle Analyzer
- Migrate from webpack to Turbopack by running `next dev` with default settings
- Debug middleware behavior using the new `proxy.ts` filename convention in Next.js 16+
- Next.js 16+ developers optimizing local dev performance
- Teams managing large codebases with slow build times
- Developers diagnosing HMR or cold-start bottlenecks
- Engineers tuning production bundle size and code-splitting
nextjs-turbopack FAQ
Only if you hit a Turbopack bug or rely on a webpack-only plugin in development. Disable with `next dev --webpack` and check the Next.js docs for your version.
On large projects, Turbopack can be 5–14x faster for restarts due to incremental bundling and file-system caching.
No. Caching is automatic and stored under `.next` by default; no extra configuration is needed for basic use.
Next.js 16+ uses `proxy.ts` as the middleware filename at the project root; older versions use `middleware.ts`. The filename is version-dependent, not bundler-dependent.
Production build behavior depends on your Next.js version. Check the official Next.js docs for whether `next build` uses Turbopack or webpack in your release.
Full instructions (SKILL.md)
Source of truth, from affaan-m/ecc.
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/ecc and the wider catalog.
nodejs-keccak256
Use Ethereum's Keccak-256, not Node's NIST SHA3, to prevent silent hashing bugs in selectors, signatures, and addresses.
nutrient-document-processing
Convert, extract, OCR, redact, sign, and fill documents via Nutrient DWS API.
nuxt4-patterns
Nuxt 4 patterns for SSR hydration, route rules, lazy loading, and safe data fetching.
openclaw-persona-forge
Forge complete OpenClaw lobster personas with guided design or gacha randomization, generating SOUL.md, identity rules, names, and avatar prompts.
opensource-pipeline
Fork, sanitize, and package private projects for safe public release through a 3-stage pipeline.
orch-add-feature
Agent skill from affaan-m/ecc.