Nextjs turbopack

From ysyecust/everything-claude-code · View interactive version

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

How to use this skill

Skill file

Next.js 与 Turbopack

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

何时使用

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

工作原理

示例

命令

next dev
next build
next start

使用

运行 next dev 以使用 Turbopack 进行本地开发。使用捆绑包分析器(参见 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.