Communitygithub.com

nextjs-turbopack

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

nextjs-turbopack란 무엇인가요?

이 스킬은 Next.js 16+에서 기본 개발 도구로 채택된 Turbopack에 관한 상세한 가이드입니다. Turbopack은 Rust로 작성된 증분 번들러로, 개발 서버 시작 시간과 핫 모듈 교체(HMR) 속도를 대규모 프로젝트에서 5~14배까지 향상시킵니다. 개발 환경에서는 기본 활성화되어 있으며, 특정 webpack 전용 플러그인이 필요하거나 버그가 발생한 경우에만 `--webpack` 플래그로 webpack으로 전환할 수 있습니다. 또한 Next.js 16.1+에서 실험적으로 제공되는 Bundle Analyzer를 통해 번들 크기를 분석하고 최적화하는 방법, 미들웨어 파일 이름 규칙(Next.js 16부터 `middleware.ts` 대신 `proxy.ts` 사용)의 변경 사항을 다룹니다. 이 스킬은 개발자와 AI 에이전트가 Next.js 16+ 애플리케이션을 효율적으로 개발하고 디버깅하는 데 필수적인 정보를 제공합니다.

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

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

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

문서

Next.js와 Turbopack

Next.js 16+는 로컬 개발 시 기본적으로 Turbopack을 사용합니다. Turbopack은 Rust로 작성된 증분 번들러로, 개발 서버 시작과 핫 업데이트 속도를 획기적으로 향상시킵니다.

사용 시점

  • Turbopack (기본 dev): 일상적인 개발에 사용합니다. 특히 대규모 앱에서 더 빠른 콜드 스타트와 HMR을 제공합니다.
  • Webpack (레거시 dev): Turbopack 버그가 발생하거나 dev에서 webpack 전용 플러그인을 사용해야 하는 경우에만 사용합니다. --webpack(또는 Next.js 버전에 따라 --no-turbopack; 해당 릴리스 문서 확인) 플래그로 비활성화합니다.
  • 프로덕션: 프로덕션 빌드 동작(next build)은 Next.js 버전에 따라 Turbopack 또는 webpack을 사용할 수 있습니다. 사용 중인 버전의 공식 Next.js 문서를 확인하세요.

사용 대상: Next.js 16+ 앱을 개발하거나 디버깅할 때, 느린 dev 시작 또는 HMR을 진단할 때, 프로덕션 번들을 최적화할 때.

작동 방식

  • Turbopack: Next.js 개발을 위한 증분 번들러입니다. 파일 시스템 캐싱을 사용하여 재시작 속도가 훨씬 빠릅니다 (예: 대규모 프로젝트에서 5~14배).
  • dev 기본값: 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를 실행합니다. Bundle Analyzer(Next.js 문서 참조)를 사용하여 코드 분할을 최적화하고 큰 의존성을 줄입니다. 가능하면 App Router와 서버 컴포넌트를 선호합니다.

미들웨어 파일 이름 지정

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

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

파일 이름 변경은 사용 중인 번들러(Turbopack 또는 webpack)가 아니라 Next.js 버전에 연결되어 있습니다. 항상 검토 중인 버전의 공식 문서를 확인하세요.

Next.js 16 프로젝트에서 proxy.ts를 잘못된 이름의 미들웨어 파일로 표시하지 마십시오. 이 파일은 올바르며 의도된 것입니다. middleware.ts로 이름을 바꾸라고 제안하면 미들웨어 실행이 중단됩니다.

참고: Next.js proxy 문서

모범 사례

  • 안정적인 Turbopack 및 캐싱 동작을 위해 최신 Next.js 16.x를 유지하세요.
  • dev 속도가 느리다면 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/claude-api

Anthropic Claude API patterns for Python and TypeScript. Covers Messages API, streaming, tool use, vision, extended thinking, batches, prompt caching, and Claude Agent SDK. Use when building applications with the Claude API or Anthropic SDKs.

affaan-m/everything-claude-code

End-to-end marketing campaign planning and execution. Covers audience research, positioning, campaign angle definition, landing page copy, email sequences, social posts, ad copy, short-form video scripts, and content calendars. Use as the orchestration layer for multi-channel product launches. Use when planning or executing a multi-channel product launch, or producing landing page, email, social, or ad copy.

affaan-m/everything-claude-code

Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.

affaan-m/everything-claude-code-conventions

Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.

affaan-m/frontend-design

Create distinctive, production-grade frontend interfaces with high design quality. Use when the user asks to build web components, pages, or applications and the visual direction matters as much as the code quality.

affaan-m/gget

gget CLI and Python workflow for quick genomic database queries, sequence lookup, BLAST-style searches, enrichment checks, and reproducible bioinformatics evidence logs.

affaan-m/literature-review

Systematic literature-review workflow for academic, biomedical, technical, and scientific topics, including search planning, source screening, synthesis, citation checks, and evidence logging.

affaan-m/motion-ui

Production-ready UI motion system for React/Next.js. Use when implementing animations, transitions, or motion patterns.

affaan-m/project-guidelines-example

Example project-specific skill template based on a real production application.

affaan-m/pubmed-database

Direct PubMed and NCBI E-utilities search workflows for biomedical literature, MeSH queries, PMID lookup, citation retrieval, and API-backed literature monitoring.

affaan-m/scholar-evaluation

Structured scholarly-work evaluation for papers, proposals, literature reviews, methods sections, evidence quality, citation support, and research-writing feedback.

affaan-m/uspto-database

USPTO patent and trademark data workflow for official record lookup, PatentSearch queries, TSDR checks, assignment data, and reproducible IP research logs.

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.

관련 스킬