forked from farion1231/cc-switch
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
33 lines (32 loc) · 751 Bytes
/
vite.config.ts
File metadata and controls
33 lines (32 loc) · 751 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
import path from "node:path";
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import { codeInspectorPlugin } from "code-inspector-plugin";
export default defineConfig(({ command }) => ({
root: "src",
plugins: [
command === "serve" &&
codeInspectorPlugin({
bundler: "vite",
}),
react(),
].filter(Boolean),
base: "./",
build: {
outDir: "../dist",
emptyOutDir: true,
},
server: {
port: 3000,
strictPort: true,
// 绑定到 127.0.0.1,避免某些环境下 WebView 无法解析 localhost
host: "127.0.0.1",
},
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
},
},
clearScreen: false,
envPrefix: ["VITE_", "TAURI_"],
}));