Skip to content

Commit e93e2b7

Browse files
Remove react-router:override-optimize-deps plugin (#13317)
Co-authored-by: Mark Dalgleish <[email protected]>
1 parent 20e6f24 commit e93e2b7

File tree

2 files changed

+5
-20
lines changed

2 files changed

+5
-20
lines changed

.changeset/wicked-birds-suffer.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@react-router/dev": patch
3+
---
4+
5+
Reinstate dependency optimization in the child compiler to fix `depsOptimizer is required in dev mode` errors when using `vite-plugin-cloudflare` and importing Node.js builtins

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

-20
Original file line numberDiff line numberDiff line change
@@ -1445,26 +1445,6 @@ export const reactRouterVitePlugin: ReactRouterVitePlugin = () => {
14451445
configureServer: undefined,
14461446
configurePreviewServer: undefined,
14471447
})),
1448-
{
1449-
name: "react-router:override-optimize-deps",
1450-
config(userConfig) {
1451-
// Prevent unnecessary dependency optimization in the child compiler
1452-
if (
1453-
ctx.reactRouterConfig.future.unstable_viteEnvironmentApi &&
1454-
userConfig.environments
1455-
) {
1456-
for (const environmentName of Object.keys(
1457-
userConfig.environments
1458-
)) {
1459-
userConfig.environments[environmentName].optimizeDeps = {
1460-
noDiscovery: true,
1461-
};
1462-
}
1463-
} else {
1464-
userConfig.optimizeDeps = { noDiscovery: true };
1465-
}
1466-
},
1467-
},
14681448
],
14691449
});
14701450
await viteChildCompiler.pluginContainer.buildStart({});

0 commit comments

Comments
 (0)