-
Notifications
You must be signed in to change notification settings - Fork 13
/
vite.config.ts
48 lines (47 loc) · 893 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 { defineConfig } from "vite";
import { vavite } from "vavite";
import { swc } from "rollup-plugin-swc3";
import react from "@vitejs/plugin-react";
import ssr from "vike/plugin";
import { join } from "node:path";
export default defineConfig({
buildSteps: [
{
name: "client",
},
{
name: "server",
config: {
build: { ssr: true },
},
},
],
ssr: {
external: ["reflect-metadata"],
},
esbuild: false,
plugins: [
{
...swc({
jsc: {
baseUrl: join(__dirname, "./src"),
paths: {
"*": ["*"],
},
transform: {
decoratorMetadata: true,
legacyDecorator: true,
},
target: "es2017",
},
}),
enforce: "pre", // Make sure this is applied before anything else
},
vavite({
handlerEntry: "/server/main.ts",
serveClientAssetsInDev: true,
}),
react(),
ssr({ disableAutoFullBuild: true }),
],
});