import type { NextConfig } from "next"; import path from "path"; const nextConfig: NextConfig = { output: "standalone", images: { unoptimized: true }, serverExternalPackages: ["better-sqlite3"], allowedDevOrigins: ["nonmonarchial-glisky-suzann.ngrok-free.dev"], trailingSlash: false, // Pin the Turbopack workspace root to THIS project. A stray // package-lock.json in ~/Documents/GitHub made Turbopack infer the parent // folder as the root, so the dev file-watcher tried to index ~40 sibling // repos and all their node_modules (200k+ files) — that's what froze the // Mac. Pinning the root keeps watching scoped to this repo. turbopack: { root: path.join(__dirname), }, // Expose the deployed build's git SHA so the deploy pipeline can confirm // the new container is live at the origin before purging the CDN cache. // Baked in at build time from the GIT_SHA env (see Dockerfile / deploy.yml). async headers() { return [ { source: "/sw.js", headers: [ { key: "Content-Type", value: "application/javascript; charset=utf-8" }, { key: "Cache-Control", value: "no-cache, no-store, must-revalidate" }, ], }, { source: "/login", headers: [ { key: "Cache-Control", value: "no-cache, no-store, must-revalidate" }, { key: "Clear-Site-Data", value: '"cache", "storage"' }, ], }, { // Media must NOT be gzip/brotli-compressed: a compressed stream can't be // byte-range-served, so the CDN returns 200 (whole file) instead of 206 // and Safari refuses to play