/** @type {import('next').NextConfig} */ const nextConfig = { images: { remotePatterns: [ { protocol: "https", hostname: "**", }, ], minimumCacheTTL: 3600, formats: ["image/avif", "image/webp"], }, compress: true, poweredByHeader: false, reactStrictMode: true, webpack: (config, { isServer }) => { config.watchOptions = { ...config.watchOptions, ignored: [ "**/node_modules/**", "**/.git/**", "**/System Volume Information/**", "**/DumpStack.log.tmp", "**/pagefile.sys", ], poll: false, }; return config; }, onDemandEntries: { maxInactiveAge: 60 * 1000, pagesBufferLength: 5, }, experimental: { optimizeCss: false, }, headers: async () => { const isDev = process.env.NODE_ENV === "development"; const headers = [ { source: "/api/:path*", headers: [ { key: "X-Content-Type-Options", value: "nosniff" }, { key: "X-Frame-Options", value: "DENY" }, { key: "X-XSS-Protection", value: "1; mode=block" }, { key: "Referrer-Policy", value: "strict-origin-when-cross-origin" }, ], }, { source: "/logos/:path*", headers: [ { key: "Cache-Control", value: isDev ? "no-cache" : "public, max-age=86400, immutable" }, ], }, ]; if (isDev) { headers.push({ source: "/(.*)", headers: [ { key: "Cache-Control", value: "no-store, no-cache, must-revalidate, proxy-revalidate" }, ], }); } else { headers.push({ source: "/_next/static/:path*", headers: [ { key: "Cache-Control", value: "public, max-age=31536000, immutable" }, ], }); } return headers; }, }; export default nextConfig;