import type { NextConfig } from "next"; import "./src/env"; const configHeader = [ // Security headers for all routes { source: "/:path*", headers: [ { key: "Referrer-Policy", value: "strict-origin-when-cross-origin" }, //{ key: "X-Frame-Options", value: "DENY" }, { key: "X-Content-Type-Options", value: "nosniff" }, // { key: "X-XSS-Protection", value: "1; mode=block" }, // { // key: "Permissions-Policy", // value: // "camera=(), microphone=(), geolocation=(), browsing-topics=()", // }, ], }, // Cache dynamic pages - shorter cache for frequently updated content // Next.js static assets - long cache with immutable // Public folder assets - long cache ]; const nextConfig: NextConfig = { output: "standalone", transpilePackages: ["@t3-oss/env-nextjs", "@t3-oss/env-core"], devIndicators: false, reactStrictMode: true, typescript: { ignoreBuildErrors: false, }, images: { unoptimized: true, remotePatterns: [], }, async headers() { return configHeader; }, async rewrites() { return [ { source: '/:slug.html', destination: '/product/:slug', }, ]; }, compress: true, experimental: { optimizePackageImports: ["lodash", "date-fns"], serverActions: { bodySizeLimit: "2mb", }, }, }; export default nextConfig;