1
0
Fork 0
mirror of https://github.com/kou029w/_.git synced 2025-01-31 06:18:07 +00:00
_/vite-ssg/renderer/_default.page.server.ts
2022-01-22 14:16:50 +00:00

17 lines
464 B
TypeScript

import { renderToString } from "solid-js/web";
import { escapeInject, dangerouslySkipEscape } from "vite-plugin-ssr";
import type { PageContextBuiltIn } from "vite-plugin-ssr/types";
export async function render(pageContext: PageContextBuiltIn) {
const page = renderToString(pageContext.Page);
return escapeInject`<!DOCTYPE html>
<html>
<head>
<title>vite-ssg-example</title>
</head>
<body>
${dangerouslySkipEscape(page)}
</body>
</html>
`;
}