Skip to content

Commit f02e12f

Browse files
committed
wip: cf plugin with noDiscovery: true
1 parent 72d05d0 commit f02e12f

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

packages/plugin-rsc/examples/react-router/cf/vite.config.ts

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,21 @@ export default defineConfig({
3636
},
3737
],
3838
}),
39+
{
40+
name: 'no-server-optimize-deps',
41+
configEnvironment: {
42+
order: 'post',
43+
handler(name) {
44+
if (name === 'ssr' || name === 'rsc') {
45+
return {
46+
optimizeDeps: {
47+
noDiscovery: true,
48+
},
49+
}
50+
}
51+
},
52+
},
53+
},
3954
],
4055
environments: {
4156
client: {
@@ -45,14 +60,14 @@ export default defineConfig({
4560
},
4661
ssr: {
4762
optimizeDeps: {
48-
include: ['react-router > cookie', 'react-router > set-cookie-parser'],
49-
exclude: ['react-router'],
63+
// include: ['react-router > cookie', 'react-router > set-cookie-parser'],
64+
// exclude: ['react-router'],
5065
},
5166
},
5267
rsc: {
5368
optimizeDeps: {
54-
include: ['react-router > cookie', 'react-router > set-cookie-parser'],
55-
exclude: ['react-router'],
69+
// include: ['react-router > cookie', 'react-router > set-cookie-parser'],
70+
// exclude: ['react-router'],
5671
},
5772
},
5873
},

0 commit comments

Comments
 (0)