mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-23 14:15:13 +00:00
fix(config): don't interpolate variables with undefined value (#8013)
This commit is contained in:
parent
866b4ddfed
commit
a7da6fd56f
@ -177,7 +177,7 @@ function expand (target, source = {}, parse = v => v) {
|
||||
value = interpolate(value)
|
||||
}
|
||||
|
||||
return newValue.replace(replacePart, value)
|
||||
return value !== undefined ? newValue.replace(replacePart, value) : newValue
|
||||
}, value))
|
||||
}
|
||||
|
||||
|
1
test/fixtures/runtime-config/.env
vendored
1
test/fixtures/runtime-config/.env
vendored
@ -2,3 +2,4 @@ BASE_URL=/api
|
||||
PUBLIC_URL=https://google.com
|
||||
SERVER_BASE_URL
|
||||
API_SECRET=1234
|
||||
TOKEN=$2yr$10$tN3JmuvXZKGwi0l38A.SxUVemGrFJiyLunyqkOqOTE7LHsrSwMEmEB
|
||||
|
3
test/fixtures/runtime-config/nuxt.config.js
vendored
3
test/fixtures/runtime-config/nuxt.config.js
vendored
@ -1,7 +1,8 @@
|
||||
export default {
|
||||
publicRuntimeConfig: {
|
||||
baseURL: process.env.BASE_URL,
|
||||
isFixture: true
|
||||
isFixture: true,
|
||||
TOKEN: 'default'
|
||||
},
|
||||
privateRuntimeConfig: {
|
||||
baseURL: '${PUBLIC_URL}${BASE_URL}',
|
||||
|
Loading…
Reference in New Issue
Block a user