AGENT SKILL

nextjs-turbopack

Next.js 16+とTurbopack — インクリメンタルバンドリング、FSキャッシング、開発速度、Turbopackとwebpackをいつどちらかどうかを選ぶか。

License 许可
MIT
最近更新
2026-11-04
Stars
★ 2
Forks
0

01 前言 Front Matter

name
nextjs-turbopack
origin
ECC
description
Next.js 16+とTurbopack — インクリメンタルバンドリング、FSキャッシング、開発速度、Turbopackとwebpackをいつどちらかどうかを選ぶか。

03 SKILL.md 正文

Next.jsとTurbopack

Next.js 16+はローカル開発にデフォルトでTurbopackを使用する。TurbopackはRustで書かれたインクリメンタルバンドラーで、開発起動時間とホットアップデートを大幅に高速化する。

使用するタイミング

  • Turbopack(デフォルト開発): 日々の開発に使用する。特に大規模アプリでコールドスタートとHMRが速い。
  • Webpack(レガシー開発): Turbopackのバグに遭遇した場合、またはwebpackのみのプラグインに依存している場合のみ使用する。--webpack(またはNext.jsのバージョンによっては--no-turbopack)で無効化する。リリースのドキュメントを確認すること。
  • プロダクション: プロダクションビルドの動作(next build)はNext.jsのバージョンによってTurbopackまたはwebpackを使用することがある。使用中のバージョンの公式Next.jsドキュメントを確認すること。

使用するケース: Next.js 16+アプリの開発またはデバッグ、開発起動やHMRの遅延を診断するとき、またはプロダクションバンドルを最適化するとき。

仕組み

  • Turbopack: Next.js開発用インクリメンタルバンドラー。ファイルシステムキャッシングを使用するため再起動が大幅に速くなる(大規模プロジェクトで5〜14倍など)。
  • 開発のデフォルト: Next.js 16から、next devは無効化しない限りTurbopackで実行される。
  • ファイルシステムキャッシング: 再起動は前回の作業を再利用する。キャッシュは通常.next以下にある。基本的な使用には追加設定は不要。
  • バンドルアナライザー(Next.js 16.1+): 実験的なバンドルアナライザーで出力を検査し重い依存関係を見つける。設定または実験的フラグで有効化する(使用中のバージョンのNext.jsドキュメントを参照)。

例

コマンド

next dev
next build
next start

使用方法

ローカル開発にはTurbopackでnext devを実行する。バンドルアナライザー(Next.jsドキュメント参照)を使用してコード分割を最適化し、大きな依存関係を削減する。可能な限りApp RouterとサーバーコンポーネントをBestPracticeとして使用する。

ベストプラクティス

  • 安定したTurbopackとキャッシングの動作のために最新のNext.js 16.xを使い続ける。
  • 開発が遅い場合は、Turbopack(デフォルト)を使用していることと、キャッシュが不必要にクリアされていないことを確認する。
  • プロダクションバンドルサイズの問題には、使用中のバージョンの公式Next.jsバンドル解析ツールを使用する。

04 同仓库更多 Skills

Cyrilthetecchieee
Cyrilthetecchieee/cyril-code-

webapp-testing

Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.

★ 2
Cyrilthetecchieee
Cyrilthetecchieee/cyril-code-

youtube-downloader

Download YouTube videos with customizable quality and format options. Use this skill when the user asks to download, save, or grab YouTube videos. Supports various quality settings (best, 1080p, 720p, 480p, 360p), multiple formats (mp4, webm, mkv), and audio-only downloads as MP3.

★ 2
Cyrilthetecchieee
Cyrilthetecchieee/cyril-code-

theme-factory

Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with colors/fonts that you can apply to any artifact that has been creating, or can generate a new theme on-the-fly.

★ 2
Cyrilthetecchieee
Cyrilthetecchieee/cyril-code-

template-skill

Replace with description of the skill and when Claude should use it.

★ 2
Cyrilthetecchieee
Cyrilthetecchieee/cyril-code-

tailored-resume-generator

Analyzes job descriptions and generates tailored resumes that highlight relevant experience, skills, and achievements to maximize interview chances

★ 2
Cyrilthetecchieee
Cyrilthetecchieee/cyril-code-

slack-gif-creator

Toolkit for creating animated GIFs optimized for Slack, with validators for size constraints and composable animation primitives. This skill applies when users request animated GIFs or emoji animations for Slack from descriptions like "make me a GIF for Slack of X doing Y".

★ 2