Communitygithub.com

JantonioFC/skillsbank

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

skillsbank 是什麼?

此技能提供關於 Next.js 16+ 與其預設開發工具 Turbopack 的深入指引。Turbopack 是一個以 Rust 編寫的增量打包工具,能顯著加速大型專案的冷啟動與 HMR(熱模組更新)。它涵蓋了何時使用 Turbopack(預設開發環境)與傳統的 webpack(僅在遇到 Turbopack 錯誤或依賴 webpack 外掛時使用)的決策情境。技能也說明了 Turbopack 如何透過文件系統快取來加速重啟,並介紹了 Next.js 16.1+ 中的實驗性 Bundle Analyzer,幫助開發者檢查輸出並優化依賴。支援的平台為 Next.js 16+ 版本,適合在開發或偵錯 Next.js 應用程式、診斷開發啟動速度或 HMR 問題,以及優化生產構建時使用。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/JantonioFC/skillsbank/tree/HEAD/skills/ck

在你喜歡的 AI 中提問

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

說明文件

Next.js 與 Turbopack

Next.js 16+ 在本地開發中預設使用 Turbopack:這是一個以 Rust 編寫的增量打包工具,能大幅提升開發啟動速度與熱更新效能。

何時使用

  • Turbopack(預設開發環境):用於日常開發。在大型應用程式中,能提供更快的冷啟動與 HMR。
  • Webpack(傳統開發環境):僅在遇到 Turbopack 錯誤或依賴僅支援 webpack 的外掛時使用。可透過 --webpack(或 --no-turbopack,取決於您的 Next.js 版本;請查閱您版本的官方文件)來停用。
  • 生產環境:生產構建行為(next build)可能使用 Turbopack 或 webpack,取決於 Next.js 版本;請查閱您版本的官方 Next.js 文件。

使用時機:在開發或偵錯 Next.js 16+ 應用程式、診斷緩慢的開發啟動或 HMR、或優化生產構建包時。

運作方式

  • Turbopack:專為 Next.js 開發設計的增量打包工具。使用文件系統快取,使得重新啟動更快(例如在大型專案中快 5–14 倍)。
  • 開發環境預設:自 Next.js 16 起,next dev 預設使用 Turbopack 執行,除非停用。
  • 文件系統快取:重新啟動時會重用先前的成果;快取通常位於 .next 目錄;基礎使用無需額外設定。
  • Bundle Analyzer(Next.js 16.1+):實驗性的 Bundle Analyzer,用於檢查輸出並找出較重的依賴;可透過設定或實驗性標記啟用(請查閱您版本的 Next.js 文件)。

範例

指令

next dev
next build
next start

使用方式

執行 next dev 以使用 Turbopack 進行本地開發。使用 Bundle Analyzer(請查閱 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.

JantonioFC/skillsbank

AI-powered image editing with style transfer and object removal

JantonioFC/skillsbank

Internationalization and localization patterns. Detecting hardcoded strings, managing translations, locale files, RTL support.

JantonioFC/skillsbank

Analise e auditoria de editais de leilao judicial e extrajudicial. Riscos ocultos, clausulas perigosas, debitos, ocupante e classificacao da oportunidade.

JantonioFC/skillsbank

Embed Photopea in web apps using photopea.js. Covers embedding, file I/O, scripting, exporting, layers, text, filters, and the full Photoshop-compatible API.

JantonioFC/skillsbank

Best practices for Remotion - Video creation in React

JantonioFC/skillsbank

Generate walkthrough videos from Stitch projects using Remotion with smooth transitions, zooming, and text overlays

JantonioFC/skillsbank

Seek and analyze video content using Memories.ai Large Visual Memory Model for persistent video intelligence

JantonioFC/skillsbank

Writes complete, structured landing pages optimized for SEO ranking, AEO citation, and visitor conversion. Activate when the user wants to write or generate a landing page for a product, service, or offer.

JantonioFC/skillsbank

Video and audio perception, indexing, and editing. Ingest files/URLs/live streams, build visual/spoken indexes, search with timestamps, edit timelines, add overlays/subtitles, generate media, and create real-time alerts.

JantonioFC/skillsbank

Upload, stream, search, edit, transcribe, and generate AI video and audio using the VideoDB SDK.

JantonioFC/skillsbank

Skill for discovering and researching autonomous AI agents, tools, and ecosystems using the AgentFolio directory.

JantonioFC/skillsbank

Expert in building portfolios that actually land jobs and clients - not just showing work, but creating memorable experiences. Covers developer portfolios, designer portfolios, creative portfolios, and portfolios that convert visitors into opportunities.

JantonioFC/skillsbank

Tool lifecycle UI components for React/Next.js from ui.inference.sh. Display tool calls: pending, progress, approval required, results. Capabilities: tool status, progress indicators, approval flows, results display. Use for: showing agent tool calls, human-in-the-loop approvals, tool output. Triggers: tool ui, tool calls, tool status, tool approval, tool results, agent tools, mcp tools ui, function calling ui, tool lifecycle, tool pending

JantonioFC/skillsbank

Security audit, hardening, threat modeling (STRIDE/PASTA), Red/Blue Team, OWASP checks, code review, incident response, and infrastructure security for any project.

JantonioFC/skillsbank

When the user wants help with paid advertising campaigns on Google Ads, Meta (Facebook/Instagram), LinkedIn, Twitter/X, or other ad platforms. Also use when the user mentions 'PPC,' 'paid media,' 'ROAS,' 'CPA,' 'ad campaign,' 'retargeting,' 'audience targeting,' 'Google Ads,' 'Facebook ads,'...

JantonioFC/skillsbank

Create AI avatar and talking head videos with OmniHuman, Fabric, PixVerse via inference.sh CLI. Models: OmniHuman 1.5, OmniHuman 1.0, Fabric 1.0, PixVerse Lipsync. Capabilities: audio-driven avatars, lipsync videos, talking head generation, virtual presenters. Use for: AI presenters, expla...

JantonioFC/skillsbank

Create AI marketing videos for ads, promos, product launches, and brand content. Models: Veo, Seedance, Wan, FLUX for visuals, Kokoro for voiceover. Types: product demos, testimonials, explainers, social ads, brand videos. Use for: Facebook ads, YouTube ads, product launches, brand awarene...

JantonioFC/skillsbank

Generate AI videos with Google Veo, Seedance, Wan, Grok and 40+ models via inference.sh CLI. Models: Veo 3.1, Veo 3, Seedance 1.5 Pro, Wan 2.5, Grok Imagine Video, OmniHuman, Fabric, HunyuanVideo. Capabilities: text-to-video, image-to-video, lipsync, avatar animation, video upscaling, fole...

JantonioFC/skillsbank

Production-ready CI/CD configurations for Playwright — GitHub Actions, GitLab CI, CircleCI, Azure DevOps, Jenkins, Docker, parallel sharding, reporting, code coverage, and global setup/teardown.

JantonioFC/skillsbank

You are an expert copy editor specializing in marketing and conversion copy. Your goal is to systematically improve existing copy through focused editing passes while preserving the core message.

相關技能