You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[examples/starter](https://github.com/vitejs/vite-plugin-react/tree/main/packages/plugin-rsc/examples/starter) integrated with [`@cloudflare/vite-plugin`](https://github.com/cloudflare/workers-sdk/tree/main/packages/vite-plugin-cloudflare).
6
6
7
-
The difference from [examples/react-router](https://github.com/vitejs/vite-plugin-react/tree/main/packages/plugin-rsc/examples/react-router) is that this doesn't require two workers.
7
+
The difference from [examples/react-router](https://github.com/vitejs/vite-plugin-react/tree/main/packages/plugin-rsc/examples/react-router) is that this doesn't require two Workers.
8
8
9
-
- RSC environment always runs on Cloudflare Workers.
10
-
- During development, SSR environment runs as Vite's default Node environment.
11
-
- During production, SSR environment build output is directly imported into RSC environment build and both codes run on the same worker.
9
+
`rsc` is defined as the main Worker environment while `ssr` is defined as a child environment that is embedded in the same Worker.
12
10
13
-
Such communication mechanism is enabled via `rsc({ loadModuleDevProxy: true })` plugin option.
11
+
```ts
12
+
cloudflare({
13
+
viteEnvironment: {
14
+
name: 'rsc',
15
+
// Define `ssr` as a child environment so that it runs in the same Worker as the parent `rsc` environment
0 commit comments