From 2def6d7e00679124fc610d728b975387c3679d34 Mon Sep 17 00:00:00 2001 From: pan93412 Date: Tue, 6 Aug 2024 00:19:16 +0800 Subject: [PATCH] fix(nuxt): use static import for `updateAppConfig` in HMR (#28349) --- packages/nuxt/src/core/templates.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/nuxt/src/core/templates.ts b/packages/nuxt/src/core/templates.ts index 30812c6181..297f7c49f6 100644 --- a/packages/nuxt/src/core/templates.ts +++ b/packages/nuxt/src/core/templates.ts @@ -341,9 +341,10 @@ import { defuFn } from 'defu' const inlineConfig = ${JSON.stringify(nuxt.options.appConfig, null, 2)} /** client **/ +import { updateAppConfig } from '#app/config' + // Vite - webpack is handled directly in #app/config if (import.meta.dev && !import.meta.nitro && import.meta.hot) { - const { updateAppConfig } = await import('#app/config') import.meta.hot.accept((newModule) => { updateAppConfig(newModule.default) })