chore: conditionalize mfe config behind demo env var (#1463)
This commit is contained in:
parent
f9652b452a
commit
691c3cb05f
2 changed files with 16 additions and 11 deletions
|
|
@ -1,11 +1,23 @@
|
||||||
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 basePath = process.env.IS_DEMO === "1" ? "/demo" : "";
|
||||||
|
|
||||||
const nextConfig: NextConfig = {
|
const nextConfig: NextConfig = {
|
||||||
basePath,
|
...(basePath
|
||||||
assetPrefix: "/demo-assets",
|
? {
|
||||||
|
basePath,
|
||||||
|
assetPrefix: "/demo-assets",
|
||||||
|
redirects: async () => [
|
||||||
|
{
|
||||||
|
source: "/",
|
||||||
|
destination: basePath,
|
||||||
|
permanent: false,
|
||||||
|
basePath: false,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
}
|
||||||
|
: {}),
|
||||||
env: {
|
env: {
|
||||||
NEXT_PUBLIC_BASE_PATH: basePath,
|
NEXT_PUBLIC_BASE_PATH: basePath,
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,3 @@
|
||||||
{
|
{
|
||||||
"framework": "nextjs",
|
"framework": "nextjs"
|
||||||
"redirects": [
|
|
||||||
{
|
|
||||||
"source": "/",
|
|
||||||
"destination": "/demo",
|
|
||||||
"permanent": false
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue