From aa830c52749ca7b34db95b9731de3e3f86f1060f Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Wed, 27 Nov 2024 14:02:27 +0000 Subject: [PATCH] chore: initialise strings within spa template --- packages/nuxt/src/core/runtime/nitro/renderer.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/nuxt/src/core/runtime/nitro/renderer.ts b/packages/nuxt/src/core/runtime/nitro/renderer.ts index 88b06d8526..431adf9c92 100644 --- a/packages/nuxt/src/core/runtime/nitro/renderer.ts +++ b/packages/nuxt/src/core/runtime/nitro/renderer.ts @@ -146,6 +146,8 @@ const getSPARenderer = lazyCachedFunction(async () => { const spaTemplate = await import('#spa-template').then(r => r.template).catch(() => '') .then((r) => { if (spaPreloaderOutside) { + const APP_SPA_LOADER_OPEN_TAG = `<${appSpaLoaderTag}${propsToString(appSpaLoaderAttrs)}>` + const APP_SPA_LOADER_CLOSE_TAG = `` const appTemplate = APP_ROOT_OPEN_TAG + APP_ROOT_CLOSE_TAG const loaderTemplate = r ? APP_SPA_LOADER_OPEN_TAG + r + APP_SPA_LOADER_CLOSE_TAG : '' return appTemplate + loaderTemplate @@ -230,9 +232,6 @@ async function getIslandContext (event: H3Event): Promise { return ctx } -const APP_SPA_LOADER_OPEN_TAG = `<${appSpaLoaderTag}${propsToString(appSpaLoaderAttrs)}>` -const APP_SPA_LOADER_CLOSE_TAG = `` - const HAS_APP_TELEPORTS = !!(appTeleportTag && appTeleportAttrs.id) const APP_TELEPORT_OPEN_TAG = HAS_APP_TELEPORTS ? `<${appTeleportTag}${propsToString(appTeleportAttrs)}>` : '' const APP_TELEPORT_CLOSE_TAG = HAS_APP_TELEPORTS ? `` : ''