conditional basepath with IS_DEMO env

This commit is contained in:
dancer 2026-03-13 23:39:12 +00:00
parent 27f2f9a9df
commit 15f626b401

View file

@ -1,11 +1,11 @@
import { withBotId } from "botid/next/config"; import { withBotId } from "botid/next/config";
import type { NextConfig } from "next"; import type { NextConfig } from "next";
const basePath = "/demo"; const isDemo = process.env.IS_DEMO === "1";
const basePath = isDemo ? "/demo" : "";
const nextConfig: NextConfig = { const nextConfig: NextConfig = {
basePath, ...(isDemo && { basePath, assetPrefix: "/demo-assets" }),
assetPrefix: "/demo-assets",
env: { env: {
NEXT_PUBLIC_BASE_PATH: basePath, NEXT_PUBLIC_BASE_PATH: basePath,
}, },