Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

Commit

Permalink
fix(schema): preserve top-level undefined keys in runtime config
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Apr 20, 2022
1 parent b82c6e3 commit 963ea58
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/schema/src/config/_common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -720,14 +720,19 @@ export default {
* @version 3
*/
runtimeConfig: {
$resolve: (val: RuntimeConfig, get) => defu(val, {
$resolve: (val: RuntimeConfig, get) => ({
...get('publicRuntimeConfig'),
...get('privateRuntimeConfig'),
public: get('publicRuntimeConfig'),
...val || {},
public: {
...get('publicRuntimeConfig'),
...val?.public || {},
},
app: {
baseURL: get('app').baseURL,
buildAssetsDir: get('app').buildAssetsDir,
cdnURL: get('app').cdnURL,
...val?.app || {},
}
})
},
Expand Down

0 comments on commit 963ea58

Please sign in to comment.