From 571bf94d39d63adaa1f26137f5285d75793d37e0 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Mon, 18 Oct 2021 10:07:09 +0100 Subject: [PATCH] fix(kit): deep assign `app` to `publicRuntimeConfig` (#1094) --- packages/kit/src/config/schema/_common.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/kit/src/config/schema/_common.ts b/packages/kit/src/config/schema/_common.ts index 1f9982034d..0810c86d09 100644 --- a/packages/kit/src/config/schema/_common.ts +++ b/packages/kit/src/config/schema/_common.ts @@ -3,6 +3,7 @@ import env from 'std-env' import createRequire from 'create-require' import { pascalCase } from 'scule' import jiti from 'jiti' +import defu from 'defu' export default { /** @@ -697,8 +698,6 @@ export default { * @version 3 */ publicRuntimeConfig: { - app: { - $resolve: (val, get) => ({ ...get('app'), ...(val || {}) }) - } + $resolve: (val, get) => defu(val, { app: get('app') }) } }