This commit is contained in:
mlogclub
2026-04-09 10:01:23 +08:00
commit efe801b8bf
707 changed files with 110595 additions and 0 deletions
+42
View File
@@ -0,0 +1,42 @@
import type { NextConfig } from "next"
import { PHASE_DEVELOPMENT_SERVER } from "next/constants"
const backendBaseUrl =
process.env.NEXT_PUBLIC_API_BASE_URL?.trim() || ""
export default function nextConfig(phase: string): NextConfig {
if (phase === PHASE_DEVELOPMENT_SERVER) {
return {
reactStrictMode: true,
trailingSlash: true,
images: {
unoptimized: true,
},
async rewrites() {
return [
{
source: "/api/:path*",
destination: `${backendBaseUrl}/api/:path*`,
basePath: false,
},
{
source: "/storage/:path*",
destination: `${backendBaseUrl}/storage/:path*`,
basePath: false,
},
]
},
}
}
return {
reactStrictMode: true,
output: "export",
basePath: "/widget",
assetPrefix: "/widget/",
trailingSlash: true,
images: {
unoptimized: true,
},
}
}