From 83c7c47bbc336cab8e6342bbc1a0d13e97d712cc Mon Sep 17 00:00:00 2001 From: sc Date: Fri, 7 May 2021 09:11:39 +0800 Subject: [PATCH] Update index.js --- src/config/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/config/index.js b/src/config/index.js index ad648fab..24c41d9f 100644 --- a/src/config/index.js +++ b/src/config/index.js @@ -8,8 +8,9 @@ const DEFAULT_CONFIG = { API_URL: "" } -//如果有外部APP_CONFIG就合并 -if(APP_CONFIG){ +// 如果生产模式,就合并动态的APP_CONFIG +// public/config.js +if(process.env.NODE_ENV === 'production'){ Object.assign(DEFAULT_CONFIG, APP_CONFIG) }