/** @type {import('next').NextConfig} */ const nextConfig = { // ۱. نادیده گرفتن خطاهای بیلد eslint: { ignoreDuringBuilds: true, }, typescript: { ignoreBuildErrors: true, }, // ۲. تنظیمات تصاویر images: { remotePatterns: [ { protocol: 'https', hostname: 'api.modstagram.ir', port: '', pathname: '/**', }, { protocol: 'https', hostname: 'app.modstagram.ir', port: '', pathname: '/**', }, { protocol: 'https', hostname: 'blog.modstagram.com', // اجازه دادن به نمایش تصاویر وبلاگ port: '', pathname: '/**', }, { protocol: 'http', hostname: 'localhost', port: '3004', pathname: '/**', }, ], formats: ['image/avif', 'image/webp'], deviceSizes: [640, 750, 828, 1080, 1200, 1920, 2048, 3840], imageSizes: [16, 32, 48, 64, 96, 128, 256, 384], minimumCacheTTL: 31536000, }, // ۳. فقط وبلاگ — API/storage از Route Handler پروکسی می‌شوند async rewrites() { return [ { source: '/blog', destination: 'https://blog.modstagram.com/blog', }, { source: '/blog/:path*', destination: 'https://blog.modstagram.com/blog/:path*', }, ]; }, server: { port: 3004, }, // ۴. تنظیمات هدرها async headers() { return [ { source: '/(.*)', headers: [ { key: 'X-DNS-Prefetch-Control', value: 'on' }, { key: 'Strict-Transport-Security', value: 'max-age=63072000; includeSubDomains; preload' }, { key: 'X-XSS-Protection', value: '1; mode=block' }, { key: 'X-Frame-Options', value: 'SAMEORIGIN' }, { key: 'X-Content-Type-Options', value: 'nosniff' }, { key: 'Referrer-Policy', value: 'origin-when-cross-origin' }, { key: 'Cache-Control', value: 'public, s-maxage=1, stale-while-revalidate=59' }, ], }, ]; }, reactStrictMode: false, }; export default nextConfig;