Skip to content

Commit

Permalink
refactor: dynamically import cloudflare adapter in dev server setup
Browse files Browse the repository at this point in the history
  • Loading branch information
rphlmr committed Jan 24, 2025
1 parent 282e418 commit a068e05
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import type { IncomingMessage, ServerResponse } from "node:http";
import path from "node:path";
import honoDevServer, { type DevServerOptions } from "@hono/vite-dev-server";
import bunAdapter from "@hono/vite-dev-server/bun";
import cloudflareAdapter from "@hono/vite-dev-server/cloudflare";
import nodeAdapter from "@hono/vite-dev-server/node";
import type { Config as ReactRouterConfig } from "@react-router/dev/config";
import type { Plugin, UserConfig } from "vite";
Expand Down Expand Up @@ -153,6 +152,7 @@ export function reactRouterHonoServer(options: ReactRouterHonoServerPluginOption
}

if (runtime === "cloudflare") {
const { cloudflareAdapter } = await import("@hono/vite-dev-server/cloudflare");
adapter = cloudflareAdapter;
}

Expand Down

0 comments on commit a068e05

Please sign in to comment.