/** @type {import('next').NextConfig} */ const basePath = process.env.NEXT_PUBLIC_BASE_PATH || ""; const remoteApiOrigin = ( process.env.CHATBOT_API_UPSTREAM || process.env.NEXT_PUBLIC_CHATBOT_API_BASE || "https://chatbot.exdev.co.kr" ).replace(/\/chatbot\/?$/, ""); const nextConfig = { output: "export", basePath, assetPrefix: basePath || undefined, trailingSlash: true, reactStrictMode: true, poweredByHeader: false, images: { unoptimized: true }, async rewrites() { if (process.env.NODE_ENV !== "development") return []; return [ { source: "/chatbot/:path*", destination: `${remoteApiOrigin}/chatbot/:path*`, }, ]; }, }; export default nextConfig;