Next.js Tooling
Priority: P2 (MEDIUM)
Standalone Docker Config
Environment Variable Validation
Implementation Guidelines
- Build: Use Turbopack (
next dev --turbo) for faster incremental builds; Webpack for legacy. - Linting: Mandate
next lint(eslint-plugin-next) andtscin CI/CD. - Bundle Analysis: Inspect with
@next/bundle-analyzer. Remove unused dependencies. - Telemetry: Opt-out via
next telemetry disableif privacy is required. - Environment: Server-only vars vs
NEXT_PUBLIC_*. Validate with Zod at runtime. - CI/CD: Cache
.next/cachein CI for 50%+ faster builds.
Anti-Patterns
- No
npm run startfor dev: Usenext dev(ornext dev --turbo). - No uninspected bundle growth: Analyze with
@next/bundle-analyzerbefore shipping. - No custom ESLint rules over plugin: Use
eslint-plugin-nextfor Next.js-aware linting. - No
console.login production: Use structured loggers (Pino, Winston).