1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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.BASE_URL = options.publicPath
|
| if (raw) {
| return env
| }
|
| for (const key in env) {
| env[key] = JSON.stringify(env[key])
| }
| return {
| 'process.env': env
| }
| }
|
|