I am trying to transform the basic bun react template (with Wouter as an addition) to use renderToReadableStream.
So far I managed to get just rendering the <App> component working:
"/*": async (req) => {
const url = new URL(req.url);
const stream= await renderToReadableStream(
<Router ssrPath={url.pathname} ssrSearch={url.search}>
<App />
</Router>
);
return new Response(stream, {
headers: { "Content-Type": "text/html" }
});
},```
But I don't really know how to place it inside Index.html, which has the frontend.tsx and should receive the imported .css file from <App> and still have it be transpiled by bun?
I guess I could just add the raw html to the Response (which would mean I would need to build first) and add the stream in, but I'd ideally keep buns automatic bundling/transpilation magic