Corrects outdated LLM knowledge about the Vercel platform and introduces new products. Injected at session start.
- Costo de contexto al activarse
- 1.8k tok
- Tamaño del paquete
- 1 archivo
- Última actualización
- hace 14 días
Turbopack expert guidance. Use when configuring the Next.js bundler, optimizing HMR, debugging build issues, or understanding the Turbopack vs Webpack differences.
en todo el repo
0–100, la ruta de este skill
último commit aquí
últimos 90 días
41 tok en reposo
10 KB
Funciona con cualquier agente que lea SKILL.md
npx -y skills add vercel/vercel-plugin --skill turbopack --agent claude-codeSe instala solo en este repositorio.
Este skill reads environment config.
You are an expert in Turbopack — the Rust-powered JavaScript/TypeScript bundler built by Vercel. It is the default bundler in Next.js 16.
In Next.js 16, Turbopack config is top-level (moved from experimental.turbopack):
// next.config.ts
import type { NextConfig } from 'next'
const nextConfig: NextConfig = {
turbopack: {
// Resolve aliases (like webpack resolve.alias)
resolveAlias: {
'old-package': 'new-package',
},
// Custom file extensions to resolve
resolveExtensions: ['.ts', '.tsx', '.js', '.jsx', '.json'],
},
}
export default nextConfig
Turbopack handles CSS natively without additional configuration.
Import global CSS in your root layout:
// app/layout.tsx
import './globals.css'
CSS Modules work out of the box with .module.css files:
// components/Button.tsx
import styles from './Button.module.css'
export function Button({ children }) {
return <button className={styles.primary}>{children}</button>
}
Turbopack reads your postcss.config.js automatically. Tailwind CSS v4 works with zero config:
// postcss.config.js
module.exports = {
plugins: {
'@tailwindcss/postcss': {},
autoprefixer: {},
},
}
Install sass and import .scss files directly — Turbopack compiles them natively:
npm install sass
import styles from './Component.module.scss'
@import in global CSS: Use standard CSS @import — Turbopack resolves them, but circular imports cause build failures.styled-components and emotion work but require their SWC plugins configured under compiler in next.config.Turbopack performs tree shaking at the module level in production builds. Key behaviors:
export on each function/constant rather than barrel export *package.json to enable aggressive tree shaking:{
"name": "my-ui-lib",
"sideEffects": false
}
index.ts) when the package declares "sideEffects": falseimport() expressions create async chunk boundaries — Turbopack splits these into separate chunks automaticallyBuilt-in analyzer (Next.js 16.1+, experimental): Works natively with Turbopack. Offers route-specific filtering, import tracing, and RSC boundary analysis:
// next.config.ts
const nextConfig: NextConfig = {
experimental: {
bundleAnalyzer: true,
},
}
Legacy @next/bundle-analyzer: Still works as a fallback:
ANALYZE=true next build
// next.config.ts
import withBundleAnalyzer from '@next/bundle-analyzer'
const nextConfig = withBundleAnalyzer({
enabled: process.env.ANALYZE === 'true',
})({
// your config
})
Turbopack does not support webpack loaders directly. Here is how to migrate common patterns:
| Webpack Loader | Turbopack Equivalent |
|---|---|
css-loader + style-loader |
Built-in CSS support — remove loaders |
sass-loader |
Built-in — install sass package |
postcss-loader |
Built-in — reads postcss.config.js |
file-loader / url-loader |
Built-in static asset handling |
svgr / @svgr/webpack |
Use @svgr/webpack via turbopack.rules |
raw-loader |
Use import x from './file?raw' |
graphql-tag/loader |
Use a build-time codegen step instead |
worker-loader |
Use native new Worker(new URL(...)) syntax |
For loaders that have no built-in equivalent, use turbopack.rules:
// next.config.ts
const nextConfig: NextConfig = {
turbopack: {
rules: {
'*.svg': {
loaders: ['@svgr/webpack'],
as: '*.js',
},
},
},
}
If a webpack loader has no Turbopack equivalent and no workaround, fall back to webpack:
const nextConfig: NextConfig = {
bundler: 'webpack',
}
File an issue at github.com/vercel/next.js — the Turbopack team tracks loader parity requests.
webpack() function from next.config — it's ignored by Turbopack and may mask the real configturbopack.rules: Ensure custom rules reference valid loaders that are installedfs, path, etc. cannot be imported in client or edge bundlesturbopack.resolveAlias covers any custom resolution that was previously in webpack config"use client" directives — each client component boundary creates a new chunkserver-only package to enforce server/client boundaries at import time:npm install server-only
// lib/db.ts
import 'server-only' // Build fails if imported in a client component
Run both bundlers and compare:
# Turbopack build (default in Next.js 16)
next build
# Webpack build
BUNDLER=webpack next build
Compare .next/ output sizes and page-level chunks.
Enable verbose HMR timing in development:
NEXT_TURBOPACK_TRACING=1 next dev
This writes a trace.json to the project root — open it in chrome://tracing or Perfetto to see module-level timing.
Profile production builds:
NEXT_TURBOPACK_TRACING=1 next build
Look for:
Turbopack's Rust core manages its own memory. If builds OOM:
NODE_OPTIONS='--max-old-space-size=8192' next buildturbo build --concurrency=2| Feature | Turbopack | Webpack |
|---|---|---|
| Language | Rust | JavaScript |
| HMR speed | Constant (O(1)) | Degrades with app size |
| RSC support | Native | Plugin-based |
| Cold start | Fast | Slower |
| Ecosystem | Growing | Massive (loaders, plugins) |
| Status in Next.js 16 | Default | Still supported |
| Tree shaking | Module-level | Module-level |
| CSS handling | Built-in | Requires loaders |
| Production builds | Supported | Supported |
ModuleFederationPlugin)externals functions)To use webpack instead:
// next.config.ts
const nextConfig: NextConfig = {
bundler: 'webpack', // Opt out of Turbopack
}
experimental.turbopack to top-level turbopack in next.config.turbopack.resolveAlias instead of webpack.resolve.alias.server-only package.Reproducido de vercel/vercel-plugin bajo licencia NOASSERTION. Leer esta página en markdown.
1 archivo en el paquete. Solo se lee SKILL.md al activarse — las referencias se cargan si el skill decide que las necesita.
Necesita en el PATH:npm
Variables de entorno:ANALYZE
Este repo incluye 43 skills. Si instalas uno, normalmente ya tienes los demás.
Corrects outdated LLM knowledge about the Vercel platform and introduces new products. Injected at session start.
Vercel Connect expert guidance — securely obtain scoped OAuth tokens for third-party services (Slack, GitHub, MCP servers, OAuth, Snowflake) on behalf of apps or users via Vercel OIDC. Use when wiring up third-party API access, connecting to MCP servers, sending Slack messages, accessing GitHub APIs, receiving webhook events from Slack/Linear/GitHub and forwarding them to your agents and apps, or building eve agent connections.
Debug Vercel CDN caching — cache hit rate, stale content, revalidation behavior, ISR + PPR, per-request cache reasons (cacheReason) and PPR state (ppr_state), and costs.
Vercel Functions expert guidance — Serverless Functions, Edge Functions, Fluid Compute, streaming, Cron Jobs, and runtime configuration. Use when configuring, debugging, or optimizing server-side code running on Vercel.
Backend architecture guidance. Use when planning, building, or migrating an API or backend; choosing between Functions, Services, containers, Workflow, Queues, and Marketplace databases; or selecting a supported backend framework or runtime.
eve framework guidance for durable AI agents and agent-powered applications. Use when creating, editing, or debugging an eve project, when the user explicitly asks for eve, or when the build-agents skill has selected eve as the default framework. Covers eve's filesystem-first runtime, durable sessions, tools, skills, connections, channels, sandboxes, subagents, schedules, evals, frontend clients, and Agent Runs observability. Do not use for incidental agent mentions, generic agent-building prompts, or established non-eve stacks unless the user asks for comparison or migration.
Next.js best practices - file conventions, RSC boundaries, data patterns, async APIs, metadata, error handling, route handlers, image/font optimization, bundling
shadcn/ui expert guidance — CLI, component installation, composition patterns, custom registries, theming, Tailwind CSS integration, and high-quality interface design. Use when initializing shadcn, adding components, composing product UI, building custom registries, configuring themes, or troubleshooting component issues.
Access and test Vercel deployments protected by Vercel Authentication, SSO, or Deployment Protection. Use when curl, agent-browser, Playwright, or another automated request reaches a Vercel login or protection page; when a protected preview or production URL returns 401 or 403; when TRUSTED_SOURCES_ENVIRONMENT_MISMATCH appears; or when choosing between `vercel curl` and the `x-vercel-trusted-oidc-idp-token` header.