import type { NextConfig } from "next"; const securityHeaders = [ { key: "Strict-Transport-Security", value: "max-age=31536000; includeSubDomains; preload" }, { key: "X-Content-Type-Options", value: "nosniff" }, { key: "X-Frame-Options", value: "DENY" }, { key: "Referrer-Policy", value: "strict-origin-when-cross-origin" }, { key: "Permissions-Policy", value: "geolocation=()" }, { key: "Cross-Origin-Opener-Policy", value: "same-origin" }, { key: "Cross-Origin-Resource-Policy", value: "same-site" }, ]; const nextConfig: NextConfig = { output: "standalone", poweredByHeader: false, experimental: { // TypeScript 5 provides the compiler API and avoids CLI output-capture issues // in restricted build environments. useTypeScriptCli: false, }, turbopack: { root: process.cwd(), }, async headers() { return [ { source: "/(.*)", headers: securityHeaders }, { source: "/downloads/:path*", headers: [ { key: "Cache-Control", value: "public, max-age=604800" }, { key: "X-Robots-Tag", value: "noindex, noarchive" }, ], }, { source: "/images/:path*", headers: [{ key: "Cache-Control", value: "public, max-age=2592000" }], }, { source: "/fonts/:path*", headers: [{ key: "Cache-Control", value: "public, max-age=2592000" }], }, ]; }, }; export default nextConfig;