refactor: standardize basePath and assetPrefix in next.config.ts for dashboard and widget

This commit is contained in:
mlogclub
2026-04-15 17:31:05 +08:00
parent 199846cfdb
commit 50edbb4da6
2 changed files with 6 additions and 2 deletions
+3
View File
@@ -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,
}
+3 -2
View File
@@ -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,