From 691c3cb05fddf292e1f52788d383937740c57cb9 Mon Sep 17 00:00:00 2001 From: Jeremy Date: Fri, 20 Mar 2026 03:21:31 -0700 Subject: [PATCH] chore: conditionalize mfe config behind demo env var (#1463) --- next.config.ts | 18 +++++++++++++++--- vercel.json | 9 +-------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/next.config.ts b/next.config.ts index 32eeb60..d066f56 100644 --- a/next.config.ts +++ b/next.config.ts @@ -1,11 +1,23 @@ import { withBotId } from "botid/next/config"; import type { NextConfig } from "next"; -const basePath = "/demo"; +const basePath = process.env.IS_DEMO === "1" ? "/demo" : ""; const nextConfig: NextConfig = { - basePath, - assetPrefix: "/demo-assets", + ...(basePath + ? { + basePath, + assetPrefix: "/demo-assets", + redirects: async () => [ + { + source: "/", + destination: basePath, + permanent: false, + basePath: false, + }, + ], + } + : {}), env: { NEXT_PUBLIC_BASE_PATH: basePath, }, diff --git a/vercel.json b/vercel.json index ced26d3..f92a3f8 100644 --- a/vercel.json +++ b/vercel.json @@ -1,10 +1,3 @@ { - "framework": "nextjs", - "redirects": [ - { - "source": "/", - "destination": "/demo", - "permanent": false - } - ] + "framework": "nextjs" }