Skip to content

Commit

Permalink
fix(): Fix vite profile hot update error reporting (#968)
Browse files Browse the repository at this point in the history
修复vite修改配置文件热更新报错Error: Must provide a proper URL as target

Co-authored-by: lou <825681860@qq.com>
  • Loading branch information
loujohn and mooccat authored Jul 23, 2021
1 parent 8702965 commit 956ed2e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion build/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 956ed2e

Please sign in to comment.