Skip to content

Commit 90d6e43

Browse files
authored
fix(dev): resolve optimizeDeps entries properly on Windows (#12637)
* fix(dev): resolve optimizeDeps entries properly on Windows * Add changeset * Sign CLA
1 parent b6c2ad1 commit 90d6e43

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

Diff for: .changeset/gentle-carrots-appear.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@react-router/dev": patch
3+
---
4+
5+
Properly resolve Windows file paths to scan for Vite's dependency optimization when using the `unstable_optimizeDeps` future flag.

Diff for: contributors.yml

+1
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,7 @@
330330
- willemarcel
331331
- williamsdyyz
332332
- willsawyerrrr
333+
- wkovacs64
333334
- xavier-lc
334335
- xcsnowcity
335336
- yionr

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -800,9 +800,9 @@ export const reactRouterVitePlugin: ReactRouterVitePlugin = () => {
800800
optimizeDeps: {
801801
entries: ctx.reactRouterConfig.future.unstable_optimizeDeps
802802
? [
803-
ctx.entryClientFilePath,
803+
vite.normalizePath(ctx.entryClientFilePath),
804804
...Object.values(ctx.reactRouterConfig.routes).map((route) =>
805-
path.join(ctx.reactRouterConfig.appDirectory, route.file)
805+
resolveRelativeRouteFilePath(route, ctx.reactRouterConfig)
806806
),
807807
]
808808
: [],

0 commit comments

Comments
 (0)