import type { NextConfig } from "next"; import path from "path"; const subDomain = process.env.NEXT_PUBLIC_PROXY_HOST || "http://localhost:3000"; const nextConfig: NextConfig = { output: "standalone", experimental: { proxyTimeout: 600000, }, // πŸ”₯ λ°˜λ“œμ‹œ ν•„μš” webpack(config) { config.resolve.alias = { ...(config.resolve.alias || {}), // monorepo ꡬ쑰 κΈ°μ€€ "@common": path.resolve(__dirname, "../../packages/common"), }; return config; }, async rewrites() { return { beforeFiles: [ { source: "/_next/static/:path*", destination: `${subDomain}/_next/static/:path*`, has: [ { type: "header", key: "referer", value: "(.*)/pst(.*)", }, ], }, ], afterFiles: [ { source: "/sewerage-service/:path*", destination: `${subDomain}/sewerage-service/:path*`, }, { source: "/reuse-service/:path*", destination: `${subDomain}/reuse-service/:path*`, }, { source: "/operation-service/:path*", destination: `${subDomain}/operation-service/:path*`, }, ], fallback: [], }; }, }; export default nextConfig;