Skip to content

Commit 00a7624

Browse files
committed
Update importing Vite in Cloudflare plugin
1 parent e5f3101 commit 00a7624

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: packages/react-router-dev/vite/cloudflare-dev-proxy.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { type Plugin } from "vite";
44
import { type GetPlatformProxyOptions, type PlatformProxy } from "wrangler";
55

66
import { fromNodeRequest, toNodeRequest } from "./node-adapter";
7-
import { preloadViteEsm, importViteEsmSync } from "./import-vite-esm-sync";
7+
import { preloadVite, getVite } from "./vite";
88

99
let serverBuildId = "virtual:react-router/server-build";
1010

@@ -45,8 +45,8 @@ export const cloudflareDevProxyVitePlugin = <Env, Cf extends CfProperties>(
4545
return {
4646
name: PLUGIN_NAME,
4747
config: async (userConfig) => {
48-
await preloadViteEsm();
49-
const vite = importViteEsmSync();
48+
await preloadVite();
49+
const vite = getVite();
5050
// a compatibility layer from Vite v6+ and below because
5151
// Vite v6 overrides the default resolve.conditions, so we have to import them
5252
// and if the export doesn't exist, it means that we're in Vite v5, so an empty array should be used

0 commit comments

Comments
 (0)