/** @type {import('next').NextConfig} */ const nextConfig = { // Removed Next.js rewrites since nginx handles all API routing webpack: (config, { isServer }) => { // Exclude cheerio and its dependencies from client-side bundling if (!isServer) { config.resolve.fallback = { ...config.resolve.fallback, fs: false, net: false, tls: false, 'undici': false, }; config.externals.push('cheerio', 'server-only'); } return config; }, images: { domains: ['localhost'], remotePatterns: [ { protocol: 'http', hostname: 'localhost', port: '80', pathname: '/images/**', }, ], }, }; module.exports = nextConfig;