diff --git a/.changeset/fair-chefs-sleep.md b/.changeset/fair-chefs-sleep.md new file mode 100644 index 0000000..34b7741 --- /dev/null +++ b/.changeset/fair-chefs-sleep.md @@ -0,0 +1,5 @@ +--- +'@hono/vite-dev-server': patch +--- + +use `ssrLoadModule` instead of Runtime API diff --git a/packages/dev-server/README.md b/packages/dev-server/README.md index 39e815c..d44af34 100644 --- a/packages/dev-server/README.md +++ b/packages/dev-server/README.md @@ -8,7 +8,7 @@ You can develop your application with Vite. It's fast. - Support any `fetch`-based applications. - Hono applications run on. - Fast by Vite. -- HMR +- HMR (Only for the client side). - Plugins are available, e.g., Cloudflare Pages. - Also runs on Bun. diff --git a/packages/dev-server/src/dev-server.ts b/packages/dev-server/src/dev-server.ts index 3b40a50..87bca07 100644 --- a/packages/dev-server/src/dev-server.ts +++ b/packages/dev-server/src/dev-server.ts @@ -72,7 +72,6 @@ export const defaultOptions: Required { @@ -95,11 +94,10 @@ export function devServer(options?: DevServerOptions): VitePlugin { } } } - runtime ??= await createViteRuntime(server) let appModule try { - appModule = await runtime.executeEntrypoint(entry) + appModule = await server.ssrLoadModule(entry) } catch (e) { return next(e) }