From e61b88c9d96ccfdf03812a257ebdc859e5cfa3a9 Mon Sep 17 00:00:00 2001 From: Thatsaphorn Atchariyaphap Date: Sun, 8 Jun 2025 21:57:46 +0200 Subject: [PATCH] Refactor basePath and assetPrefix in next.config.ts for improved readability --- lawfirm-demos/demo-1/next.config.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lawfirm-demos/demo-1/next.config.ts b/lawfirm-demos/demo-1/next.config.ts index 63df2b7..b303e29 100644 --- a/lawfirm-demos/demo-1/next.config.ts +++ b/lawfirm-demos/demo-1/next.config.ts @@ -2,13 +2,16 @@ import type {NextConfig} from "next"; const isProd = process.env.NODE_ENV === 'production'; +const basePath = isProd ? '/lawfirm/demo1' : ''; +const assetPrefix = isProd ? '/lawfirm/demo1' : ''; + console.log(`🚀 [next.config.ts] Running in ${process.env.NODE_ENV} mode`); -console.log(`👉 basePath: ${isProd ? '/lawfirm/demo1' : '(none)'}`); +console.log(`👉 basePath: ${basePath || '(none)'}`); const nextConfig: NextConfig = { output: 'standalone', - basePath: isProd ? '/lawfirm/demo1' : '', - assetPrefix: isProd ? '/lawfirm/demo1' : '', + basePath, + assetPrefix, }; export default nextConfig;