Skip to content

Commit eaff91b

Browse files
committed
Skip react-router-serve config in dev
1 parent 655cb45 commit eaff91b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/react-router-dev/vite/rsc/plugin.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,11 @@ export function reactRouterRSCVitePlugin(): Vite.PluginOption[] {
505505
}
506506
},
507507
load(id) {
508+
// react-router-serve is not used in dev mode
509+
if (viteCommand !== "build") {
510+
return `export default {};`;
511+
}
512+
508513
if (id === virtual.reactRouterServeConfig.resolvedId) {
509514
const rscOutDir = resolvedViteConfig.environments.rsc?.build?.outDir;
510515
invariant(rscOutDir, "RSC build directory config not found");

0 commit comments

Comments
 (0)