-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
43 lines (41 loc) · 1.27 KB
/
vite.config.ts
File metadata and controls
43 lines (41 loc) · 1.27 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
import { defineConfig } from 'vite';
import preact from '@preact/preset-vite';
import tailwindcss from '@tailwindcss/vite';
const host = process.env.TAURI_DEV_HOST;
// Dev-only note: opening vite.config.ts / tsconfig.json / vitest.config.ts /
// vitest.setup.ts in an external editor (via Open In) touches their mtime and
// triggers Vite's hardcoded config-restart watcher, causing the webview to
// reload. Not a bug — server.watch.ignored does not cover this path. Harmless
// in `pnpm tauri build`.
export default defineConfig({
plugins: [preact(), tailwindcss()],
clearScreen: false,
server: {
port: 1420,
strictPort: true,
host: host || false,
hmr: host ? { protocol: 'ws', host, port: 1421 } : undefined,
watch: {
ignored: [
'**/src-tauri/**',
'**/.git/**',
'**/.planning/**',
'**/.claude/**',
'**/.github/**',
'**/RESEARCH/**',
'**/node_modules/**',
'**/repomix-output.*',
'**/CLAUDE.md',
'**/README.md',
'**/pnpm-lock.yaml',
'**/package-lock.json',
],
},
},
envPrefix: ['VITE_', 'TAURI_ENV_*'],
build: {
target: 'safari16',
minify: !process.env.TAURI_ENV_DEBUG ? 'esbuild' : false,
sourcemap: !!process.env.TAURI_ENV_DEBUG,
},
});