feat: websocket HMR
This commit is contained in:
parent
d86e696cd2
commit
767cd4d564
|
@ -11,12 +11,17 @@ import { RemixServer } from "@remix-run/react";
|
|||
import { isbot } from "isbot";
|
||||
import { renderToPipeableStream } from "react-dom/server";
|
||||
|
||||
import websocketServer from './websocket';
|
||||
|
||||
const ABORT_DELAY = 5_000;
|
||||
|
||||
export async function websocket(server) {
|
||||
await websocketServer(server);
|
||||
export async function websocket(server, viteDevServer) {
|
||||
if (viteDevServer) {
|
||||
const {createViteRuntime} = await import('vite');
|
||||
const runtime = await createViteRuntime(viteDevServer);
|
||||
(await runtime.executeEntrypoint('/app/websocket.js')).default(server);
|
||||
}
|
||||
else {
|
||||
(await import('./websocket.js')).default(server);
|
||||
}
|
||||
}
|
||||
|
||||
export default function handleRequest(
|
||||
|
|
Loading…
Reference in New Issue
Block a user