-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathvite.config.ts
More file actions
54 lines (52 loc) · 1011 Bytes
/
vite.config.ts
File metadata and controls
54 lines (52 loc) · 1011 Bytes
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
import { defineConfig } from "vite"
import vue from "@vitejs/plugin-vue"
import path from "path"
// @ts-expect-error process is a nodejs global
const host = process.env.TAURI_DEV_HOST
const port = parseInt(process.env.VITE_PORT || "18080")
const hmrPort = parseInt(process.env.VITE_HMR_PORT || "18081")
export default defineConfig(async () => ({
plugins: [vue()],
clearScreen: false,
build: {
rollupOptions: {
output: {
manualChunks: {
"pixi-core": ["pixi.js"],
"pixi-live2d": ["pixi-live2d-display"],
},
},
},
},
server: {
port,
strictPort: true,
host: host || false,
hmr: host
? {
protocol: "ws",
host,
port: hmrPort,
}
: {
protocol: "ws",
port: hmrPort,
},
watch: {
ignored: ["**/src-tauri/**"],
},
},
optimizeDeps: {
include: ["pixi.js", "pixi-live2d-display"],
esbuildOptions: {
define: {
global: "globalThis",
},
},
},
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
},
},
}))