Update dependencies and improve build system
This commit is contained in:
22
service/utils/resolveClientEnv.js
Normal file
22
service/utils/resolveClientEnv.js
Normal file
@@ -0,0 +1,22 @@
|
||||
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.PUBLIC_PATH = options.publicPath
|
||||
|
||||
if (raw) {
|
||||
return env
|
||||
}
|
||||
|
||||
for (const key in env) {
|
||||
env[key] = JSON.stringify(env[key])
|
||||
}
|
||||
return {
|
||||
'process.env': env,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user