diff --git a/dashboard/next.config.ts b/dashboard/next.config.ts index e26fc7f..bfcc388 100644 --- a/dashboard/next.config.ts +++ b/dashboard/next.config.ts @@ -3,10 +3,13 @@ import { PHASE_DEVELOPMENT_SERVER } from "next/constants" const backendBaseUrl = process.env.NEXT_PUBLIC_API_BASE_URL?.trim() || "http://127.0.0.1:8083" +const productionBasePath = "/dashboard" export default function nextConfig(phase: string): NextConfig { const config: NextConfig = { output: "export", + basePath: productionBasePath, + assetPrefix: `${productionBasePath}/`, trailingSlash: true, } diff --git a/widget/next.config.ts b/widget/next.config.ts index 712ae55..0197ef3 100644 --- a/widget/next.config.ts +++ b/widget/next.config.ts @@ -3,6 +3,7 @@ import { PHASE_DEVELOPMENT_SERVER } from "next/constants" const backendBaseUrl = process.env.NEXT_PUBLIC_API_BASE_URL?.trim() || "http://127.0.0.1:8083" +const productionBasePath = "/widget" export default function nextConfig(phase: string): NextConfig { if (phase === PHASE_DEVELOPMENT_SERVER) { @@ -32,8 +33,8 @@ export default function nextConfig(phase: string): NextConfig { return { reactStrictMode: true, output: "export", - basePath: "/widget", - assetPrefix: "/widget/", + basePath: productionBasePath, + assetPrefix: `${productionBasePath}/`, trailingSlash: true, images: { unoptimized: true,