Skip to content

Commit

Permalink
Merge pull request #11952 from remix-run/pedro/disable-dot-server-det…
Browse files Browse the repository at this point in the history
…ection-for-optimize-deps

`ssr` field will be omitted and `scan` will be `true` when vite does its
  • Loading branch information
pcattori authored Sep 4, 2024
2 parents 5aa7769 + fcd11ad commit 26cc9d9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/react-router-dev/vite/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1325,7 +1325,12 @@ export const reactRouterVitePlugin: ReactRouterVitePlugin = (_config) => {
name: "react-router-dot-server",
enforce: "pre",
async resolveId(id, importer, options) {
if (options?.ssr) return;
// https://vitejs.dev/config/dep-optimization-options
let isOptimizeDeps =
viteCommand === "serve" &&
(options as { scan?: boolean })?.scan === true;

if (isOptimizeDeps || options?.ssr) return;

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

0 comments on commit 26cc9d9

Please sign in to comment.