fix(config): don't interpolate variables with undefined value (#8013)

This commit is contained in:
pooya parsa 2020-09-03 11:42:17 +00:00 committed by GitHub
parent 866b4ddfed
commit a7da6fd56f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 2 deletions

View File

@ -177,7 +177,7 @@ function expand (target, source = {}, parse = v => v) {
value = interpolate(value) value = interpolate(value)
} }
return newValue.replace(replacePart, value) return value !== undefined ? newValue.replace(replacePart, value) : newValue
}, value)) }, value))
} }

View File

@ -2,3 +2,4 @@ BASE_URL=/api
PUBLIC_URL=https://google.com PUBLIC_URL=https://google.com
SERVER_BASE_URL SERVER_BASE_URL
API_SECRET=1234 API_SECRET=1234
TOKEN=$2yr$10$tN3JmuvXZKGwi0l38A.SxUVemGrFJiyLunyqkOqOTE7LHsrSwMEmEB

View File

@ -1,7 +1,8 @@
export default { export default {
publicRuntimeConfig: { publicRuntimeConfig: {
baseURL: process.env.BASE_URL, baseURL: process.env.BASE_URL,
isFixture: true isFixture: true,
TOKEN: 'default'
}, },
privateRuntimeConfig: { privateRuntimeConfig: {
baseURL: '${PUBLIC_URL}${BASE_URL}', baseURL: '${PUBLIC_URL}${BASE_URL}',