Skip to content

Commit d487ae0

Browse files
committed
Update importing Vite in Cloudflare plugin
1 parent da3a4ec commit d487ae0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/react-router-dev/vite/cloudflare-dev-proxy.ts

Lines changed: 4 additions & 4 deletions
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

@@ -44,9 +44,9 @@ export const cloudflareDevProxyVitePlugin = <Env, Cf extends CfProperties>(
4444

4545
return {
4646
name: PLUGIN_NAME,
47-
config: async (userConfig) => {
48-
await preloadViteEsm();
49-
const vite = importViteEsmSync();
47+
config: async () => {
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)