/** @type {import('next').NextConfig} */ const nextConfig = { reactStrictMode: true, compiler: { styledComponents: true, }, devIndicators: { appIsrStatus: false, buildActivity: false, buildActivityPosition: 'bottom-right', }, env: { MONGODB_URI: process.env.MONGODB_URI, JWT_SECRET: process.env.JWT_SECRET, RESEND_API_KEY: process.env.RESEND_API_KEY, }, images: { remotePatterns: [ { protocol: 'https', hostname: 'image.tmdb.org', pathname: '/**', }, // Локальная разработка { protocol: 'http', hostname: 'localhost', port: '3000', pathname: '/images/**', }, // Продакшен на Vercel { protocol: 'https', hostname: 'neomovies-api.vercel.app', pathname: '/images/**', }, { protocol: 'https', hostname: 'neo-movies.vercel.app', pathname: '/images/**', } ], }, onDemandEntries: { maxInactiveAge: 25 * 1000, pagesBufferLength: 2, }, typescript: { ignoreBuildErrors: true, }, experimental: { scrollRestoration: true, }, async headers() { return [ { source: '/api/:path*', headers: [ { key: 'Access-Control-Allow-Origin', value: '*' }, { key: 'Access-Control-Allow-Methods', value: 'GET, POST, PUT, DELETE, OPTIONS' }, { key: 'Access-Control-Allow-Headers', value: 'Content-Type, Authorization' }, ], }, ]; }, }; module.exports = nextConfig;