diff --git a/packages/app/src/vite-ssr-plugin.ts b/packages/app/src/vite-ssr-plugin.ts index 31c0449..ba21918 100644 --- a/packages/app/src/vite-ssr-plugin.ts +++ b/packages/app/src/vite-ssr-plugin.ts @@ -1,4 +1,5 @@ import type { Plugin, ViteDevServer, ModuleNode } from "vite"; +import fs from "node:fs"; import path from "node:path"; import { ssrPrefetch } from "./ssr-prefetch.ts"; @@ -106,7 +107,7 @@ export function ssrDevPlugin({ isMultiSphere = false } = {}): Plugin { } // Read and transform the index.html template - let template = await Bun.file(path.resolve(server.config.root, "index.html")).text(); + let template = fs.readFileSync(path.resolve(server.config.root, "index.html"), "utf-8"); template = await server.transformIndexHtml(url, template); // Load the SSR entry via Vite's module graph (supports HMR)