-
-
Notifications
You must be signed in to change notification settings - Fork 242
Expand file tree
/
Copy pathvite.config.ts
More file actions
56 lines (55 loc) · 1.2 KB
/
vite.config.ts
File metadata and controls
56 lines (55 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import { cloudflare } from '@cloudflare/vite-plugin'
import rsc from '@vitejs/plugin-rsc'
import tailwindcss from '@tailwindcss/vite'
import react from '@vitejs/plugin-react'
import { defineConfig } from 'vite'
// import inspect from 'vite-plugin-inspect'
export default defineConfig((env) => ({
clearScreen: false,
build: {
minify: false,
},
plugins: [
// inspect(),
tailwindcss(),
react(),
rsc({
entries: {
client: './react-router-vite/entry.browser.tsx',
ssr: './react-router-vite/entry.ssr.tsx',
},
serverHandler: false,
loadModuleDevProxy: true,
}),
cloudflare({
configPath: './cf/wrangler.jsonc',
viteEnvironment: {
name: 'rsc',
},
}),
],
environments: {
client: {
optimizeDeps: {
include: ['react-router', 'react-router/internal/react-server-client'],
},
},
ssr: {
keepProcessEnv: false,
build: {
outDir: './dist/rsc/ssr',
},
resolve:
env.command === 'build'
? {
noExternal: true,
}
: undefined,
},
rsc: {
optimizeDeps: {
exclude: ['react-router'],
},
},
},
}))