-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathvite.config.server.ts
More file actions
53 lines (52 loc) · 1.1 KB
/
vite.config.server.ts
File metadata and controls
53 lines (52 loc) · 1.1 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
import { defineConfig } from "vite";
import path from "path";
// Server build configuration
export default defineConfig({
build: {
lib: {
entry: path.resolve(__dirname, "server/node-build.ts"),
name: "server",
fileName: "production",
formats: ["es"],
},
outDir: "dist/server",
target: "node22",
ssr: true,
rollupOptions: {
external: [
// Node.js built-ins
"fs",
"path",
"url",
"http",
"https",
"os",
"crypto",
"stream",
"util",
"events",
"buffer",
"querystring",
"child_process",
// External dependencies that should not be bundled
"express",
"cors",
],
output: {
format: "es",
entryFileNames: "[name].mjs",
},
},
minify: false, // Keep readable for debugging
sourcemap: true,
},
resolve: {
alias: {
"@": path.resolve(__dirname, "./client"),
"@shared": path.resolve(__dirname, "./shared"),
},
},
define: {
"process.env.NODE_ENV": '"production"',
},
});