-
Notifications
You must be signed in to change notification settings - Fork 164
Expand file tree
/
Copy pathvite.config.ts
More file actions
89 lines (87 loc) · 2.85 KB
/
vite.config.ts
File metadata and controls
89 lines (87 loc) · 2.85 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
import path from "node:path"
import { defineConfig } from "vite"
import react from "@vitejs/plugin-react"
import jotaiDebugLabel from "jotai/babel/plugin-debug-label"
import jotaiReactRefresh from "jotai/babel/plugin-react-refresh"
const host = process.env.TAURI_DEV_HOST
// https://vitejs.dev/config/
export default defineConfig(() => {
return {
build: {
host: host || false,
// Tauri uses Chromium on Windows and WebKit on macOS and Linux
target:
process.env.TAURI_ENV_PLATFORM == "windows"
? "chrome105"
: "safari13",
// don"t minify for debug builds
minify: !process.env.TAURI_ENV_DEBUG ? "esbuild" as const : false,
// produce sourcemaps for debug builds
sourcemap: !!process.env.TAURI_ENV_DEBUG,
},
resolve: {
alias: {
"@": path.join(__dirname, "src"),
"@codemirror/state": path.resolve(
__dirname,
"./node_modules/@codemirror/state/dist/index.js"
),
"@codemirror/view": path.resolve(
__dirname,
"./node_modules/@codemirror/view/dist/index.js"
),
"@codemirror/lint": path.resolve(
__dirname,
"./node_modules/@codemirror/lint/dist/index.js"
),
"@codemirror/lang-json": path.resolve(
__dirname,
"./node_modules/@codemirror/lang-json/dist/index.js"
),
"@codemirror/linter": path.resolve(
__dirname,
"./node_modules/@codemirror/linter/dist/index.js"
),
"@codemirror/theme-one-dark": path.resolve(
__dirname,
"./node_modules/@codemirror/theme-one-dark/dist/index.js"
),
"@codemirror/autocomplete": path.resolve(
__dirname,
"./node_modules/@codemirror/autocomplete/dist/index.js"
),
"@codemirror/commands": path.resolve(
__dirname,
"./node_modules/@codemirror/commands/dist/index.js"
),
"@codemirror/language": path.resolve(
__dirname,
"./node_modules/@codemirror/language/dist/index.js"
),
"@codemirror/search": path.resolve(
__dirname,
"./node_modules/@codemirror/search/dist/index.js"
),
"@uiw/react-codemirror": path.resolve(
__dirname,
"node_modules/@uiw/react-codemirror/esm/index.js",
),
"@uiw/codemirror-extensions-basic-setup": path.resolve(
__dirname,
"node_modules/@uiw/codemirror-extensions-basic-setup/esm/index.js"
),
},
},
plugins: [
react({babel: { plugins: [jotaiDebugLabel, jotaiReactRefresh] }}),
],
server: {
strictPort: true,
watch: {
ignored: ["**/mcp-host/**", "**/src-tauri/**", "**/target/**", "**/release/**"],
exclude: ["**/mcp-host/**"],
},
},
envPrefix: ["VITE_", "TAURI_ENV_*"],
}
})