Communitygithub.com

ComeOnOliver/skillshub

Next.js 16+ 與 Turbopack — 增量打包、檔案系統快取、開發速度,以及何時使用 Turbopack 與 webpack。

skillshub 是什麼?

此技能說明了 Next.js 16+ 與 Turbopack 的整合,Turbopack 是以 Rust 撰寫的增量式打包工具,在開發環境中預設啟用,可顯著提升開發啟動速度與熱模組替換效能。技能幫助開發者判斷何時該使用 Turbopack、何時需退回 webpack,以及生產環境建置的行為差異。它詳細介紹了 Turbopack 的檔案系統快取機制,可在重啟時保留先前的編譯結果,並提及 Next.js 16.1 以上版本的實驗性 Bundle Analyzer,用於檢查輸出與找出大型依賴。此外,技能支援常見的開發命令與最佳實踐,適合診斷開發速度瓶頸或最佳化生產環境打包的開發者。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/ComeOnOliver/skillshub/tree/HEAD/skills/affaan-m/everything-claude-code/nextjs-turbopack

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

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 文件)。

範例

指令

next dev
next build
next start

使用

執行 next dev 以使用 Turbopack 進行本地開發。使用打包分析器(參見 Next.js 文件)來最佳化程式碼分割並剔除大型依賴。盡可能優先使用 App Router 和伺服器元件。

最佳做法

  • 保持使用較新的 Next.js 16.x 版本,以獲得穩定的 Turbopack 和快取行為。
  • 如果開發速度慢,請確保你正在使用 Turbopack(預設),並且快取沒有被不必要地清除。
  • 對於生產環境打包大小問題,請使用你所用版本的官方 Next.js 打包分析工具。

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

ComeOnOliver/skillshub

Create stunning, animation-rich HTML presentations from scratch or by converting PowerPoint files. Use when the user wants to build a presentation, convert a PPT/PPTX to web, or create slides for a talk/pitch. Helps non-designers discover their aesthetic through visual exploration rather than abstract choices.

ComeOnOliver/skillshub

SwiftUI architecture patterns, state management with @Observable, view composition, navigation, performance optimization, and modern iOS/macOS UI best practices.

ComeOnOliver/skillshub

See, Understand, Act on video and audio. See- ingest from local files, URLs, RTSP/live feeds, or live record desktop; return realtime context and playable stream links. Understand- extract frames, build visual/semantic/temporal indexes, and search moments with timestamps and auto-clips. Act- transcode and normalize (codec, fps, resolution, aspect ratio), perform timeline edits (subtitles, text/image overlays, branding, audio overlays, dubbing, translation), generate media assets (image, audio, video), and create real time alerts for events from live streams or desktop capture.

ComeOnOliver/skillshub

AI-assisted video editing workflows for cutting, structuring, and augmenting real footage. Covers the full pipeline from raw capture through FFmpeg, Remotion, ElevenLabs, fal.ai, and final polish in Descript or CapCut. Use when the user wants to edit video, cut footage, create vlogs, or build video content.

ComeOnOliver/skillshub

Next.js 15 애플리케이션을 위한 프론트엔드 개발 가이드라인. React 19, TypeScript, Shadcn/ui, Tailwind CSS를 사용한 모던 패턴. Server Components, Client Components, App Router, 파일 구조, Shadcn/ui 컴포넌트, 성능 최적화, TypeScript 모범 사례 포함. 컴포넌트, 페이지, 기능 생성, 데이터 페칭, 스타일링, 라우팅, 프론트엔드 코드 작업 시 사용.

ComeOnOliver/skillshub

Provides Tamagui patterns for config v4, compiler optimization, styled context, and cross-platform styling. Must use when working with Tamagui projects (tamagui.config.ts, @tamagui imports).

ComeOnOliver/skillshub

Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.

ComeOnOliver/skillshub

Create high-converting, visually distinctive landing pages. Use when building marketing pages, product launches, SaaS homepages, or any single-page conversion-focused website. Guides section-by-section composition with anti-AI-slop principles.

ComeOnOliver/skillshub

Auto-loaded context for Portfolio Buddy 2 development. Use for ANY task involving: React 19 development, TypeScript, portfolio analysis features, metrics calculations, trading strategy comparison, or working with the Portfolio Buddy 2 codebase. Contains tech stack, known issues, and architectural constraints.

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.

ComeOnOliver/skillshub

Implement UI using Shadcn MCP (atoms/theme) and 21st.dev MCP (complex sections). Use when adding buttons, layouts, or generating landing pages.

ComeOnOliver/skillshub

A conceptual skill for building an API client in Next.js that handles JWT tokens

ComeOnOliver/skillshub

Best practices and patterns for Next.js App Router, Server Actions, and Routing in this project.

ComeOnOliver/skillshub

The Design System, Theme, and UX rules for the Physical AI Hub.

ComeOnOliver/skillshub

Comprehensive frontend development skill for building modern, performant web applications using ReactJS, NextJS, TypeScript, Tailwind CSS. Includes component scaffolding, performance optimization, bundle analysis, and UI best practices. Use when developing frontend features, optimizing performance, implementing UI/UX designs, managing state, or reviewing frontend code.

ComeOnOliver/skillshub

This document captures learnings from fixing keyboard navigation issues when floating components (Select, DropdownMenu, Popover) have CSS open/close animations.

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.

ComeOnOliver/skillshub

Comprehensive Framer Motion animation library for React. Covers motion components, variants, gestures, page transitions, and scroll animations. Use when adding animations to React/Next.js applications.

ComeOnOliver/skillshub

Next.js 16+ uses App Router with Server Components by default. Client Components are only used when interactivity is needed (hooks, event handlers, browser APIs).

ComeOnOliver/skillshub

Build interfaces that resonate, not just render. This skill enforces bold, intentional

相關技能