import type { NextConfig } from "next"; const isDev = process.env.NODE_ENV === "development"; const nextConfig: NextConfig = { ...(isDev ? { async rewrites() { return [ { source: "/api/:path*", destination: "http://localhost:3721/api/:path*", }, { source: "/ws/:path*", destination: "http://localhost:3721/ws/:path*", }, ]; }, } : { output: "export", trailingSlash: true, }), }; export default nextConfig;