Commit 956ed2e3f770cc9cf822ce80f71b1e7f179792fb
Committed by
GitHub
1 parent
87029650
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>
Showing
1 changed file
with
5 additions
and
1 deletions
build/utils.ts
... | ... | @@ -34,7 +34,11 @@ export function wrapperEnv(envConf: Recordable): ViteEnv { |
34 | 34 | } catch (error) {} |
35 | 35 | } |
36 | 36 | ret[envName] = realName; |
37 | - process.env[envName] = realName; | |
37 | + if (typeof realName === 'string') { | |
38 | + process.env[envName] = realName; | |
39 | + } else if (typeof realName === 'object') { | |
40 | + process.env[envName] = JSON.stringify(realName); | |
41 | + } | |
38 | 42 | } |
39 | 43 | return ret; |
40 | 44 | } | ... | ... |