修复环境变量被替换的问题

pull/930/merge
lyswhut 2022-05-29 10:48:05 +08:00
parent ae18db45a4
commit 90ea0dc857
3 changed files with 4 additions and 1 deletions

View File

@ -14,6 +14,7 @@ module.exports = merge(baseConfig, {
NODE_ENV: '"development"',
ELECTRON_DISABLE_SECURITY_WARNINGS: 'true',
},
ENVIRONMENT: 'process.env',
__VUE_OPTIONS_API__: 'true',
__VUE_PROD_DEVTOOLS__: 'false',
__static: `"${path.join(__dirname, '../../src/static').replace(/\\/g, '\\\\')}"`,

View File

@ -31,6 +31,7 @@ module.exports = merge(baseConfig, {
'process.env': {
NODE_ENV: '"production"',
},
ENVIRONMENT: 'process.env',
__VUE_OPTIONS_API__: 'true',
__VUE_PROD_DEVTOOLS__: 'false',
}),

View File

@ -53,7 +53,8 @@ export default () => {
getEnvParams().then(envParams => {
// 移除代理相关的环境变量设置,防止请求库自动应用它们
for (const key of Object.keys(process.env)) {
// eslint-disable-next-line no-undef
for (const key of Object.keys(ENVIRONMENT)) {
if (/^(?:http_proxy|https_proxy|NO_PROXY)$/i.test(key)) delete process.env[key]
}
const envProxy = envParams.cmdParams['proxy-server']