diff --git a/.changeset/big-beers-run.md b/.changeset/big-beers-run.md new file mode 100644 index 00000000000..75d605c92a2 --- /dev/null +++ b/.changeset/big-beers-run.md @@ -0,0 +1,5 @@ +--- +"@remix-run/dev": patch +--- + +fix(dev): optimizeDeps entries file path for vite diff --git a/packages/remix-dev/vite/plugin.ts b/packages/remix-dev/vite/plugin.ts index e18bf788568..130ac416638 100644 --- a/packages/remix-dev/vite/plugin.ts +++ b/packages/remix-dev/vite/plugin.ts @@ -1107,9 +1107,9 @@ export const remixVitePlugin: RemixVitePlugin = (remixUserConfig = {}) => { optimizeDeps: { entries: ctx.remixConfig.future.unstable_optimizeDeps ? [ - ctx.entryClientFilePath, + importViteEsmSync().normalizePath(ctx.entryClientFilePath), ...Object.values(ctx.remixConfig.routes).map((route) => - path.join(ctx.remixConfig.appDirectory, route.file) + resolveRelativeRouteFilePath(route, ctx.remixConfig) ), ] : [],