/** @type {import('next').NextConfig} */ const nextConfig = { reactStrictMode: true, output: "standalone", serverExternalPackages: ["mongodb"], async headers() { // The page shell must NEVER be cached: hashed chunk filenames change every // build, and a stale HTML pins the browser to chunk hashes that no longer // exist -> hydration dies and the skeleton hangs forever (learned on // forthena 2026-08-30). Static assets keep immutability. return [ { source: "/", headers: [{ key: "Cache-Control", value: "no-cache, no-store, must-revalidate" }], }, { source: "/api/:path*", headers: [{ key: "Cache-Control", value: "no-store" }], }, { source: "/_next/static/:path*", headers: [{ key: "Cache-Control", value: "public, max-age=31536000, immutable" }], }, ]; }, }; module.exports = nextConfig;