Skip to content

Commit 26cc9d9

Browse files
authored
Merge pull request #11952 from remix-run/pedro/disable-dot-server-detection-for-optimize-deps
`ssr` field will be omitted and `scan` will be `true` when vite does its
2 parents 5aa7769 + fcd11ad commit 26cc9d9

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

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

+6-1
Original file line numberDiff line numberDiff line change
@@ -1325,7 +1325,12 @@ export const reactRouterVitePlugin: ReactRouterVitePlugin = (_config) => {
13251325
name: "react-router-dot-server",
13261326
enforce: "pre",
13271327
async resolveId(id, importer, options) {
1328-
if (options?.ssr) return;
1328+
// https://vitejs.dev/config/dep-optimization-options
1329+
let isOptimizeDeps =
1330+
viteCommand === "serve" &&
1331+
(options as { scan?: boolean })?.scan === true;
1332+
1333+
if (isOptimizeDeps || options?.ssr) return;
13291334

13301335
let isResolving = options?.custom?.["react-router-dot-server"] ?? false;
13311336
if (isResolving) return;

0 commit comments

Comments
 (0)