修复环境变量被替换的问题
parent
ae18db45a4
commit
90ea0dc857
|
@ -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, '\\\\')}"`,
|
||||
|
|
|
@ -31,6 +31,7 @@ module.exports = merge(baseConfig, {
|
|||
'process.env': {
|
||||
NODE_ENV: '"production"',
|
||||
},
|
||||
ENVIRONMENT: 'process.env',
|
||||
__VUE_OPTIONS_API__: 'true',
|
||||
__VUE_PROD_DEVTOOLS__: 'false',
|
||||
}),
|
||||
|
|
|
@ -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']
|
||||
|
|
Loading…
Reference in New Issue