Skip to content

Commit

Permalink
LA_TEMP SSR flag
Browse files Browse the repository at this point in the history
  • Loading branch information
lourot committed Dec 18, 2023
1 parent fd1e29d commit bb06405
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions examples/basic/pages/+config.h.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ export default {
title: "My Vike Solid App",
// <meta name="description">
description: "Demo showcasing vike-solid",
ssr: true, // LA_TEMP
extends: vikeSolid,
} satisfies Config;
6 changes: 6 additions & 0 deletions vike-solid/renderer/+onRenderHtml.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ const onRenderHtml: OnRenderHtmlAsync = async (
const favicon = pageContext.config.favicon;
const faviconTag = !favicon ? '' : escapeInject`<link rel="icon" href="${favicon}" />`;

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
Expand Down
6 changes: 6 additions & 0 deletions vike-solid/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

0 comments on commit bb06405

Please sign in to comment.