import type { NextConfig } from "next"; const isDev = process.env.NODE_ENV === 'development'; const nextConfig: NextConfig = { output: isDev ? undefined : 'export', distDir: 'dist', images: { remotePatterns: [ { protocol: 'https', hostname: '**', }, ], formats: ['image/avif', 'image/webp'], deviceSizes: [640, 750, 828, 1080, 1200, 1920, 2048, 3840], imageSizes: [16, 32, 48, 64, 96, 128, 256, 384], dangerouslyAllowSVG: true, contentDispositionType: 'attachment', contentSecurityPolicy: "default-src 'self'; script-src 'none'; sandbox;", minimumCacheTTL: 60, unoptimized: !isDev, }, compress: true, poweredByHeader: false, reactStrictMode: true, experimental: { optimizePackageImports: ['lucide-react', 'framer-motion'], optimizeCss: true, }, compiler: { removeConsole: process.env.NODE_ENV === 'production', }, headers: async () => { return [ { source: '/:all*(svg|jpg|jpeg|png|gif|webp|avif)', locale: false, headers: [ { key: 'Cache-Control', value: 'public, max-age=31536000, immutable', }, ], }, { source: '/_next/static/:all*', locale: false, headers: [ { key: 'Cache-Control', value: 'public, max-age=31536000, immutable', }, ], }, ]; }, }; export default nextConfig;