/** @type {import('next').NextConfig} */ const nextConfig = { output: 'standalone', reactStrictMode: true, swcMinify: true, // Exclude SSE route from static generation experimental: { serverComponentsExternalPackages: ['chokidar'] }, basePath: process.env.BASE_URL || '', env: { NEXT_PUBLIC_BASE_URL: process.env.BASE_URL || '', }, // Handle API routes that shouldn't be statically generated async headers() { return [ { source: '/api/posts/stream', headers: [ { key: 'Cache-Control', value: 'no-cache, no-store, must-revalidate', }, ], }, ]; }, } module.exports = nextConfig