-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
48 lines (47 loc) · 921 Bytes
/
vite.config.ts
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
import devServer, { defaultOptions } from "@hono/vite-dev-server"
import { defineConfig } from "vite"
export default defineConfig(({ mode }) => {
if (mode === "client") {
return {
build: {
rollupOptions: {
input: "./src/client.tsx",
output: {
entryFileNames: "static/client.js",
},
},
},
resolve: {
alias: {
"@": "/src",
},
},
optimizeDeps: {
entries: [],
},
}
} else {
return {
ssr: {
external: ["react", "react-dom"],
},
plugins: [
devServer({
exclude: ["/*", ...defaultOptions.exclude],
entry: "src/index.tsx",
}),
],
server: {
port: 4448,
},
resolve: {
alias: {
"@": "/src",
},
},
optimizeDeps: {
entries: [],
},
}
}
})