fix(): Fix vite profile hot update error reporting (#968)

修复vite修改配置文件热更新报错Error: Must provide a proper URL as target

Co-authored-by: lou <825681860@qq.com>
This commit is contained in:
loujohn 2021-07-23 11:58:02 +08:00 committed by GitHub
parent 8702965057
commit 956ed2e3f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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