Before flipping the switch to prod, walk through this list. Each item is a 5-minute check that prevents a 5-hour incident.
next build runs without warnings (treat warnings as errors)console.log statements remain (lint or strip with babel)1// next.config.ts
2const config: NextConfig = {
3 poweredByHeader: false,
4 reactStrictMode: true,
5 productionBrowserSourceMaps: false,
6 compiler: { removeConsole: { exclude: ["error", "warn"] } },
7 experimental: {
8 optimizePackageImports: ["lucide-react", "date-fns"],
9 },
10 async headers() {
11 return [
12 {
13 source: "/(.*)",
14 headers: [
15 { key: "X-Content-Type-Options", value: "nosniff" },
16 { key: "X-Frame-Options", value: "SAMEORIGIN" },
17 { key: "Referrer-Policy", value: "strict-origin-when-cross-origin" },
18 ],
19 },
20 ];
21 },
22};| Metric | Good | Needs Work | Poor |
|---|---|---|---|
| LCP (Largest Contentful Paint) | < 2.5s | 2.5–4s | > 4s |
| INP (Interaction to Next Paint) | < 200ms | 200–500ms | > 500ms |
| CLS (Cumulative Layout Shift) | < 0.1 | 0.1–0.25 | > 0.25 |
Measure with PageSpeed Insights, Vercel Speed Insights, or Lighthouse on a throttled 4G profile.
priority on the hero image — adds it to the preload listnext/font — no DNS lookupstartTransition for non-urgent updatesdynamic(() => import("Chart"))WHERE / ORDER BY columninclude / select to eager-load)| Concern | Tool |
|---|---|
| Errors | Sentry, Bugsnag |
| Logs | Logtail, Axiom, Datadog |
| Metrics | Vercel Analytics, Grafana |
| Uptime | BetterStack, Pingdom |
Report-Only)npm audit --omit=dev)