Skip to content

Commit

Permalink
fix(dev): resolve optimizeDeps entries properly on Windows (#12637)
Browse files Browse the repository at this point in the history
* fix(dev): resolve optimizeDeps entries properly on Windows

* Add changeset

* Sign CLA
  • Loading branch information
wKovacs64 authored Jan 22, 2025
1 parent b6c2ad1 commit 90d6e43
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/gentle-carrots-appear.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@react-router/dev": patch
---

Properly resolve Windows file paths to scan for Vite's dependency optimization when using the `unstable_optimizeDeps` future flag.
1 change: 1 addition & 0 deletions contributors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@
- willemarcel
- williamsdyyz
- willsawyerrrr
- wkovacs64
- xavier-lc
- xcsnowcity
- yionr
Expand Down
4 changes: 2 additions & 2 deletions packages/react-router-dev/vite/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -800,9 +800,9 @@ export const reactRouterVitePlugin: ReactRouterVitePlugin = () => {
optimizeDeps: {
entries: ctx.reactRouterConfig.future.unstable_optimizeDeps
? [
ctx.entryClientFilePath,
vite.normalizePath(ctx.entryClientFilePath),
...Object.values(ctx.reactRouterConfig.routes).map((route) =>
path.join(ctx.reactRouterConfig.appDirectory, route.file)
resolveRelativeRouteFilePath(route, ctx.reactRouterConfig)
),
]
: [],
Expand Down

0 comments on commit 90d6e43

Please sign in to comment.