aboutsummaryrefslogtreecommitdiff
path: root/examples/nexty/framework.server.development.tsx
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <jarred@jarredsumner.com> 2021-08-10 18:26:16 -0700
committerGravatar Jarred Sumner <jarred@jarredsumner.com> 2021-08-10 18:26:16 -0700
commit10b4b872a2824b6d7c66030dafc831f0da3309e8 (patch)
treea26e97e9e7be22c4407ccc628a54eecf09516c1f /examples/nexty/framework.server.development.tsx
parent0daff24b16487acfb420813793bc432f8ceaf333 (diff)
downloadbun-10b4b872a2824b6d7c66030dafc831f0da3309e8.tar.gz
bun-10b4b872a2824b6d7c66030dafc831f0da3309e8.tar.zst
bun-10b4b872a2824b6d7c66030dafc831f0da3309e8.zip
This is alot
Former-commit-id: 4b2a396611ec03270dc768b70e488b0f5eee2a37
Diffstat (limited to 'examples/nexty/framework.server.development.tsx')
-rw-r--r--examples/nexty/framework.server.development.tsx46
1 files changed, 0 insertions, 46 deletions
diff --git a/examples/nexty/framework.server.development.tsx b/examples/nexty/framework.server.development.tsx
deleted file mode 100644
index 0e28dac65..000000000
--- a/examples/nexty/framework.server.development.tsx
+++ /dev/null
@@ -1,46 +0,0 @@
-import ReactDOMServer from "react-dom/server.browser";
-
-addEventListener("fetch", async (event: FetchEvent) => {
- var route = Wundle.match(event);
-
- console.log("Main:", Wundle.main);
- console.log("cwd:", Wundle.cwd);
- console.log("Origin:", Wundle.origin);
-
- const { default: PageComponent } = await import(route.filePath);
- // This returns all .css files that were imported in the line above.
- // It's recursive, so any file that imports a CSS file will be included.
- const stylesheets = Wundle.getImportedStyles() as string[];
-
- const response = new Response(`
- <!DOCTYPE html>
-<html>
- <head>
- ${stylesheets
- .map((style) => `<link rel="stylesheet" href="${style}">`)
- .join("\n")}
-
- <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>
-
- <div id="reactroot">${ReactDOMServer.renderToString(
- <PageComponent />
- )}</div>
-
- <script src="${route.scriptSrc}" async type="module"></script>
- </body>
-</html>
- `);
-
- event.respondWith(response);
-});
-
-// typescript isolated modules
-export {};
-
-declare var Wundle: any;