nextjs-turbopack

Next.js 16+ 和 Turbopack — 增量打包、文件系统缓存、开发速度,以及何时使用 Turbopack 与 webpack。

25 stars

Best use case

nextjs-turbopack is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Next.js 16+ 和 Turbopack — 增量打包、文件系统缓存、开发速度,以及何时使用 Turbopack 与 webpack。

Teams using nextjs-turbopack should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/nextjs-turbopack/SKILL.md --create-dirs "https://raw.githubusercontent.com/ComeOnOliver/skillshub/main/skills/affaan-m/everything-claude-code/nextjs-turbopack/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/nextjs-turbopack/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How nextjs-turbopack Compares

Feature / Agentnextjs-turbopackStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Next.js 16+ 和 Turbopack — 增量打包、文件系统缓存、开发速度,以及何时使用 Turbopack 与 webpack。

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Next.js 与 Turbopack

Next.js 16+ 在本地开发中默认使用 Turbopack:这是一个用 Rust 编写的增量捆绑器,能显著加快开发启动和热更新的速度。

## 何时使用

* **Turbopack (默认开发模式)**:用于日常开发。冷启动和热模块替换速度更快,尤其是在大型应用中。
* **Webpack (旧版开发模式)**:仅当遇到 Turbopack 错误或依赖仅在开发中可用的 webpack 插件时使用。可通过 `--webpack`(或 `--no-turbopack`,具体取决于你的 Next.js 版本;请查阅你所用版本的文档)来禁用。
* **生产环境**:生产构建行为 (`next build`) 可能使用 Turbopack 或 webpack,这取决于 Next.js 版本;请查阅你所用版本的官方 Next.js 文档。

适用场景:开发或调试 Next.js 16+ 应用,诊断开发启动或热模块替换速度慢的问题,或优化生产环境捆绑包。

## 工作原理

* **Turbopack**:用于 Next.js 开发的增量捆绑器。利用文件系统缓存,因此重启速度要快得多(例如,在大型项目中快 5–14 倍)。
* **开发环境默认启用**:从 Next.js 16 开始,`next dev` 默认使用 Turbopack,除非被禁用。
* **文件系统缓存**:重启时会复用之前的工作成果;缓存通常位于 `.next` 下;基本使用无需额外配置。
* **捆绑包分析器 (Next.js 16.1+)**:实验性的捆绑包分析器,用于检查输出并发现重型依赖;可通过配置或实验性标志启用(请查阅你所用版本的 Next.js 文档)。

## 示例

### 命令

```bash
next dev
next build
next start
```

### 使用

运行 `next dev` 以使用 Turbopack 进行本地开发。使用捆绑包分析器(参见 Next.js 文档)来优化代码分割并剔除大型依赖。尽可能优先使用 App Router 和服务器组件。

## 最佳实践

* 保持使用较新的 Next.js 16.x 版本,以获得稳定的 Turbopack 和缓存行为。
* 如果开发速度慢,请确保你正在使用 Turbopack(默认),并且缓存没有被不必要地清除。
* 对于生产环境捆绑包大小问题,请使用你所用版本的官方 Next.js 捆绑包分析工具。

Related Skills

react-nextjs-development

25
from ComeOnOliver/skillshub

React and Next.js 14+ application development with App Router, Server Components, TypeScript, Tailwind CSS, and modern frontend patterns.

nextjs-supabase-auth

25
from ComeOnOliver/skillshub

Expert integration of Supabase Auth with Next.js App Router Use when: supabase auth next, authentication next.js, login supabase, auth middleware, protected route.

nextjs-best-practices

25
from ComeOnOliver/skillshub

Next.js App Router principles. Server Components, data fetching, routing patterns.

nextjs-app-router-patterns

25
from ComeOnOliver/skillshub

Master Next.js 14+ App Router with Server Components, streaming, parallel routes, and advanced data fetching. Use when building Next.js applications, implementing SSR/SSG, or optimizing React Server Components.

nextjs-15-specialist

25
from ComeOnOliver/skillshub

Use when working with Next.js 15 features, App Router, Server Components, Server Actions, or data fetching patterns. Ensures correct usage of Server vs Client Components and modern Next.js patterns.

nextjs-15-patterns

25
from ComeOnOliver/skillshub

Next.js 15 App Router patterns and best practices.

frontend-nextjs-app-router

25
from ComeOnOliver/skillshub

Use when working with Next.js App Router tasks - creating pages in /app/, setting up dynamic routes ([id]/page.tsx), implementing nested layouts/templates (layout.tsx), optimizing Server/Client components, or building ERP role-based pages (admin/teacher/student dashboards). Auto-use for all /app/ directory operations, dynamic routing, and App Router-specific features.

building-nextjs-apps

25
from ComeOnOliver/skillshub

Build Next.js 16 applications with correct patterns and distinctive design. Use when creating pages, layouts, dynamic routes, upgrading from Next.js 15, or implementing proxy.ts. Covers breaking changes (async params/searchParams, Turbopack, cacheComponents) and frontend aesthetics. NOT when building non-React or backend-only applications.

nextjs-devtools

25
from ComeOnOliver/skillshub

Next.js development tooling via MCP. Inspect routes, components, build info, and debug Next.js apps. Use when working on Next.js applications, debugging routing, or inspecting app structure. NOT for general React or non-Next.js projects.

Turbopack — Rust-Powered Bundler for Next.js

25
from ComeOnOliver/skillshub

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.

nextjs-upgrade

25
from ComeOnOliver/skillshub

Next.js version migrations using official guides and codemods. Use when migrating a Next.js project to a new major version using codemods. (triggers: package.json, next upgrade, migration guide, codemod)

nextjs-tooling

25
from ComeOnOliver/skillshub

Ecosystem optimization, deployment, and developer flow. Use when configuring Next.js build optimization, deployment settings, or developer tooling. (triggers: next.config.js, package.json, Dockerfile, turbopack, output, standalone, lint, telemetry)