import renderToString from "preact-render-to-string"; import { escapeInject, dangerouslySkipEscape } from "vite-plugin-ssr"; import type { PageContextBuiltIn } from "vite-plugin-ssr/types"; export async function render(pageContext: PageContextBuiltIn) { const { Page } = pageContext; const html = renderToString(); return escapeInject` vite-ssg-example ${dangerouslySkipEscape(html)} `; }