From 4879af1163def3a9fc779d6497bb0e78e97b3f33 Mon Sep 17 00:00:00 2001 From: Aurelien Lourot Date: Mon, 7 Aug 2023 10:06:25 +0200 Subject: [PATCH] LA_TEMP SSR flag --- examples/basic/pages/+config.h.ts | 1 + vike-solid/renderer/+onRenderHtml.tsx | 6 ++++++ vike-solid/vite.config.ts | 6 ++++++ 3 files changed, 13 insertions(+) diff --git a/examples/basic/pages/+config.h.ts b/examples/basic/pages/+config.h.ts index a316842..667bdbc 100644 --- a/examples/basic/pages/+config.h.ts +++ b/examples/basic/pages/+config.h.ts @@ -11,5 +11,6 @@ export default { title: "My Vike Solid App", // description: "Demo showcasing vike-solid", + ssr: true, // LA_TEMP extends: vikeSolid, } satisfies Config; diff --git a/vike-solid/renderer/+onRenderHtml.tsx b/vike-solid/renderer/+onRenderHtml.tsx index cd9e12c..5d5ff2a 100644 --- a/vike-solid/renderer/+onRenderHtml.tsx +++ b/vike-solid/renderer/+onRenderHtml.tsx @@ -33,6 +33,12 @@ const onRenderHtml: OnRenderHtmlAsync = async ( const favicon = pageContext.config.favicon; const faviconTag = !favicon ? '' : escapeInject``; + if (!pageContext.Page) { + console.log("LA_TEMP SSR disabled"); + } else { + console.log("LA_TEMP SSR enabled"); + } + const { pipe } = renderToStream(() => !pageContext.Page ? ( <> // the ssr config flag is false diff --git a/vike-solid/vite.config.ts b/vike-solid/vite.config.ts index ed6cce4..388bf58 100644 --- a/vike-solid/vite.config.ts +++ b/vike-solid/vite.config.ts @@ -9,6 +9,12 @@ const config: UserConfig = { server: { port: process.env.PORT ? parseInt(process.env.PORT) : undefined, }, + optimizeDeps: { + include: [ + // LA_TEMP toggle (comment/uncomment) this line to force a full rebuild: + "vike-solid/renderer/onRenderClient", + ], + }, }; export default config;