Nextjs turbopack

From aaione/everything-claude-code-zh · View interactive version

Nextjs turbopack is an AI agent skill from the GitHub repository aaione/everything-claude-code-zh. Next.js 16+ 和 Turbopack — 增量打包、FS 缓存、开发速度,以及何时使用 Turbopack vs webpack。

How to use this skill

Skill file

Next.js 和 Turbopack

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

何时使用

在以下情况使用:开发或调试 Next.js 16+ 应用、诊断缓慢的开发启动或 HMR,或优化生产包。

工作原理

示例

命令

next dev
next build
next start

使用

运行 next dev 进行带有 Turbopack 的本地开发。使用 Bundle 分析器(查看 Next.js 文档)优化代码分割和修剪大型依赖。尽可能使用 App Router 和服务端组件。

最佳实践

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.