/** @type {import('next').NextConfig} */ const nextConfig = { // Only use standalone output for Docker builds ...(process.env.NODE_ENV === 'production' && { output: 'standalone' }), env: { NEXT_PUBLIC_API_URL: process.env.NEXT_PUBLIC_API_URL || 'https://candivista.com', }, // Only add rewrites for production (Docker) ...(process.env.NODE_ENV === 'production' && { async rewrites() { const apiUrl = process.env.NEXT_PUBLIC_API_URL || 'https://candivista.com'; return [ { source: '/rest/:path*', destination: `${apiUrl}/rest/:path*`, }, ]; }, }), } module.exports = nextConfig