1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23import { defineConfig } from "vite";
import vinext from "vinext";
import mdx from "@mdx-js/rollup";
import { cloudflare } from "@cloudflare/vite-plugin";
export default defineConfig({
plugins: [
// MDX support โ compiles .mdx files into React components
mdx(),
// vinext plugin (provides all next/* shims, routing, SSR, RSC)
vinext(),
// Cloudflare Workers plugin โ builds for workerd runtime
cloudflare({
viteEnvironment: {
name: "rsc",
childEnvironments: ["ssr"],
},
}),
],
});