From 956ed2e3f770cc9cf822ce80f71b1e7f179792fb Mon Sep 17 00:00:00 2001 From: loujohn Date: Fri, 23 Jul 2021 11:58:02 +0800 Subject: [PATCH] fix(): Fix vite profile hot update error reporting (#968) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复vite修改配置文件热更新报错Error: Must provide a proper URL as target Co-authored-by: lou <825681860@qq.com> --- build/utils.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/build/utils.ts b/build/utils.ts index f610363ba..7f61a09a7 100644 --- a/build/utils.ts +++ b/build/utils.ts @@ -34,7 +34,11 @@ export function wrapperEnv(envConf: Recordable): ViteEnv { } catch (error) {} } ret[envName] = realName; - process.env[envName] = realName; + if (typeof realName === 'string') { + process.env[envName] = realName; + } else if (typeof realName === 'object') { + process.env[envName] = JSON.stringify(realName); + } } return ret; }