From c59a4ccae3b479e166d9e6dcf2d1dc578492ba69 Mon Sep 17 00:00:00 2001 From: Harlan Wilton Date: Mon, 13 Nov 2023 19:22:09 +1100 Subject: [PATCH] fix: safer page SSR check Fixes #32 --- src/runtime/nitro-plugin.ts | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/src/runtime/nitro-plugin.ts b/src/runtime/nitro-plugin.ts index 16b60a9..03bf80c 100644 --- a/src/runtime/nitro-plugin.ts +++ b/src/runtime/nitro-plugin.ts @@ -34,7 +34,6 @@ export default defineNitroPlugin((nitro) => { return let extraScripts = '' - let isPageSSR = true if (currentMode === 'init') { const ASSET_RE = new RegExp(`]*src="${config.app.buildAssetsDir}[^>]+><\\/script>`) @@ -42,18 +41,7 @@ export default defineNitroPlugin((nitro) => { htmlContext.head = htmlContext.head.map((head: string) => head.replaceAll(LINK_ASSET_RE, '')) const toLoad: Record[] = [] - const ssrContext = htmlContext.bodyAppend.find(b => b.includes('window.__NUXT__')) - const NUXT_DATA_RE = /