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; }