Communitygithub.com

Next.js Turbopack

Next.js 16+와 Turbopack — 증분 번들링, 파일 시스템 캐싱, 개발 속도, 그리고 Turbopack과 webpack 사용 시기

Next.js Turbopack란 무엇인가요?

이 스킬은 Next.js 16 이상에서 Turbopack을 활용한 개발 경험을 최적화하는 방법을 설명합니다. Turbopack은 Rust로 작성된 증분 번들러로, 기본 개발 서버에서 사용되어 콜드 스타트와 핫 모듈 교체(HMR)를 크게 가속화합니다. 주요 사용 사례로는 일상적인 개발, 느린 개발 시작 또는 HMR 진단, 프로덕션 번들 최적화가 포함됩니다. 또한 `proxy.ts` 미들웨어 파일 명명 규칙과 같은 Next.js 16의 새로운 기능을 다루며, Turbopack 버그나 webpack 전용 플러그인에 의존해야 하는 경우 `--webpack` 플래그를 사용하여 webpack으로 전환하는 방법도 안내합니다. 프로덕션 빌드 동작은 Next.js 버전에 따라 달라질 수 있으므로 공식 문서를 참조해야 합니다.

지원 대상~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/affaan-m/ECC/tree/main/skills/nextjs-turbopack

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

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

사용법

로컬 개발을 위해 next dev를 실행하여 Turbopack을 사용합니다. 번들 분석기(Next.js 문서 참조)를 사용하여 코드 분할을 최적화하고 큰 종속성을 줄입니다. 가능한 경우 App Router와 서버 컴포넌트를 선호합니다.

미들웨어 파일 명명

Next.js 16은 이전 middleware.ts 규칙을 대체하여 proxy.ts를 미들웨어 파일 이름으로 도입했습니다.

  • Next.js 16+: 프로젝트 루트에 proxy.ts 사용
  • Next.js 16 이전: 프로젝트 루트에 middleware.ts 사용

파일 이름 변경은 Next.js 버전에 따라 결정되며, 사용 중인 번들러(Turbopack 또는 webpack)와는 무관합니다. 항상 검토 중인 버전의 공식 문서를 확인하세요.

Next.js 16 프로젝트에서 proxy.ts를 잘못 명명되었거나 누락된 미들웨어 파일로 표시하지 마세요. 이 파일은 올바르며 의도된 것입니다. middleware.ts로 이름을 변경하도록 제안하면 미들웨어 실행이 중단됩니다.

참고: Next.js proxy 문서

모범 사례

  • 안정적인 Turbopack 및 캐싱 동작을 위해 최신 Next.js 16.x를 유지하세요.
  • 개발이 느린 경우 Turbopack(기본값)을 사용 중이고 캐시가 불필요하게 지워지지 않는지 확인하세요.
  • 프로덕션 번들 크기 문제가 발생하면 해당 버전의 공식 Next.js 번들 분석 도구를 사용하세요.

Individual skills in this repo

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

accessibility

Design, implement, and audit inclusive digital products using WCAG 2.2 Level AA. Use when building or auditing UI that must meet WCAG 2.2 Level AA, or when reviewing a change for keyboard, contrast, or screen-reader support.

affaan-m/content-engine

Create platform-native content systems for X, LinkedIn, TikTok, YouTube, newsletters, and repurposed multi-platform campaigns. Use when the user wants social posts, threads, scripts, content calendars, or one source asset adapted cleanly across platforms.

affaan-m/ECC

Multi-platform content distribution across X, LinkedIn, Threads, and Bluesky. Adapts content per platform using content-engine patterns. Never posts identical content cross-platform. Use when the user wants to distribute content across social platforms.

affaan-m/fal-ai-media

Unified media generation via fal.ai MCP — image, video, and audio. Covers text-to-image (Nano Banana), text/image-to-video (Seedance, Kling, Veo 3), text-to-speech (CSM-1B), and video-to-audio (ThinkSound). Use when the user wants to generate images, videos, or audio with AI.

affaan-m/manim-video

日本語翻訳:このファイルは manim-video 用の日本語翻訳が必要です

affaan-m/remotion-video-creation

Remotion のベストプラクティス - React で動画を作成する。3D、アニメーション、音声、字幕、チャート、トランジションなどをカバーするドメイン固有の29のルール。

affaan-m/video-editing

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.

agent-architecture-audit

Full-stack diagnostic for agent and LLM applications. Audits the 12-layer agent stack for wrapper regression, memory pollution, tool discipline failures, hidden repair loops, and rendering corruption. Produces severity-ranked findings with code-first fixes. Essential for developers building agent applications, autonomous loops, or any LLM-powered feature. Use when an agent or LLM feature misbehaves and the failing layer is unknown, or before shipping an agent stack.

agent-eval

Head-to-head comparison of coding agents (Claude Code, Aider, Codex, etc.) on custom tasks with pass rate, cost, time, and consistency metrics. Use when choosing between coding agents, or when a change to an agent setup needs measured pass rate, cost, and time rather than an impression.

agent-harness-construction

Design and optimize AI agent action spaces, tool definitions, and observation formatting for higher completion rates. Use when defining or revising an agent

agentic-engineering

Operate as an agentic engineer using eval-first execution, decomposition, and cost-aware model routing. Use when planning or executing engineering work that agents will carry out end to end.

agentic-os

Build persistent multi-agent operating systems on Claude Code. Covers kernel architecture, specialist agents, slash commands, file-based memory, scheduled automation, and state management without external databases. Use when building a persistent multi-agent system on Claude Code with its own memory, commands, and scheduling.

agent-introspection-debugging

Structured self-debugging workflow for AI agent failures using capture, diagnosis, contained recovery, and introspection reports. Use when an agent run fails and you need a reproducible diagnosis instead of a retry.

agent-payment-x402

Add x402 payment execution to AI agents with per-task budgets, spending controls, and non-custodial wallets. Supports Base through agentwallet-sdk and X Layer through OKX Payments / OKX Agent Payments Protocol. Use when an agent must pay for something itself and needs per-task budgets, spending controls, and a non-custodial wallet.

agent-self-evaluation

Use after completing any non-trivial task. The agent self-rates its output on 5 axes — accuracy, completeness, clarity, actionability, conciseness — with concrete evidence per criterion. Produces a structured 1-5 scorecard with specific improvement suggestions.

agent-sort

Build an evidence-backed ECC install plan for a specific repo by sorting skills, commands, rules, hooks, and extras into DAILY vs LIBRARY buckets using parallel repo-aware review passes. Use when ECC should be trimmed to what a project actually needs instead of loading the full bundle.

ai-first-engineering

Engineering operating model for teams where AI agents generate a large share of implementation output. Use when setting team process, review gates, or ownership rules for a codebase largely written by agents.

ai-regression-testing

Regression testing strategies for AI-assisted development. Sandbox-mode API testing without database dependencies, automated bug-check workflows, and patterns to catch AI blind spots where the same model writes and reviews code. Use when adding regression coverage to AI-assisted code, or when the same model both wrote and reviewed a change.

android-clean-architecture

Clean Architecture patterns for Android and Kotlin Multiplatform projects — module structure, dependency rules, UseCases, Repositories, and data layer patterns. Use when structuring modules, layers, or data flow in an Android or KMP project.

angular-developer

Generates Angular code and provides architectural guidance. Trigger when creating projects, components, or services, or for best practices on reactivity (signals, linkedSignal, resource), forms, dependency injection, routing, SSR, accessibility (ARIA), animations, styling (component styles, Tailwind CSS), testing, or CLI tooling.

관련 스킬