blob: 0d1e5d18c920f10dd52ed50539f4b226e3aafdea (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
import ReactDOMServer from "react-dom/server.browser";
import { Base } from "./src/index";
addEventListener("fetch", (event: FetchEvent) => {
const response = new Response(`
<!DOCTYPE html>
<html>
<head>
<link
rel="stylesheet"
crossorigin="anonymous"
href="https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;700&family=Space+Mono:wght@400;700"
/>
</head>
<body>
<link rel="stylesheet" href="./src/index.css" />
<div id="reactroot">${ReactDOMServer.renderToString(<Base />)}</div>
<script src="./src/index.tsx" async type="module"></script>
</body>
</html>
`);
event.respondWith(response);
});
// typescript isolated modules
export {};
|