技能创建器
skill-creator
创建、改进和评估自定义技能,把专业流程转化为可重复使用的 AI 能力。
nextjs-optimization【数据与研究】Optimize images, fonts, scripts, and metadata for Next.js performance and Core Web Vitals. Use when configuring next/image for LCP, next/font for zero layout shift, next/script loading strategies, or generateMetadata for SEO.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Core optimization primitives provided by Next.js. Monitor First, Optimize Later.
next/speed-insights, React Profiler.Always use next/image to prevent CLS and enable automatic optimization:
Use next/font for zero layout shift — self-hosts fonts and adds font-display: swap:
Use next/script with appropriate loading strategies:
beforeInteractive: Critical scripts (polyfills).afterInteractive: Analytics (Google Analytics).lazyOnload: Chat widgets, social embeds.@next/bundle-analyzer. Prune heavy libraries; use ESM-tree-shakable dependencies.dynamic imports with Suspense for large components not needed at initial render.ppr: true (Partial Prerendering) in Next.js 15+ for static shell + dynamic islands.<img> tag: Use next/image to prevent CLS and enable automatic optimization.next/font to self-host and eliminate layout shift._document.tsx: Use export const metadata or generateMetadata().<head>: Use next/script with appropriate strategy.