mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-24 04:55:08 +08:00
23 lines
429 B
JavaScript
23 lines
429 B
JavaScript
|
|
const prefixRE = /^VUE_APP_/
|
||
|
|
|
||
|
|
module.exports = function resolveClientEnv (options, raw) {
|
||
|
|
const env = {}
|
||
|
|
Object.keys(process.env).forEach(key => {
|
||
|
|
if (prefixRE.test(key) || key === 'NODE_ENV') {
|
||
|
|
env[key] = process.env[key]
|
||
|
|
}
|
||
|
|
})
|
||
|
|
env.BASE_URL = options.publicPath
|
||
|
|
|
||
|
|
if (raw) {
|
||
|
|
return env
|
||
|
|
}
|
||
|
|
|
||
|
|
for (const key in env) {
|
||
|
|
env[key] = JSON.stringify(env[key])
|
||
|
|
}
|
||
|
|
return {
|
||
|
|
'process.env': env
|
||
|
|
}
|
||
|
|
}
|