diff --git a/ui-next/next.config.ts b/ui-next/next.config.ts index 32142d7..bd3d47b 100644 --- a/ui-next/next.config.ts +++ b/ui-next/next.config.ts @@ -2,9 +2,13 @@ import type { NextConfig } from "next"; import createMDX from "@next/mdx"; import createNextIntlPlugin from "next-intl/plugin"; +const devOrigins = process.env.NEXT_ALLOWED_DEV_ORIGINS + ? process.env.NEXT_ALLOWED_DEV_ORIGINS.split(",").map((origin) => origin.trim()).filter(Boolean) + : undefined; + const nextConfig: NextConfig = { pageExtensions: ["ts", "tsx", "md", "mdx"], - allowedDevOrigins: ["mini2.local", "192.168.1.192"], + ...(process.env.NODE_ENV === "development" && devOrigins?.length ? { allowedDevOrigins: devOrigins } : {}), }; const withMDX = createMDX({});