-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvite.config.ts
More file actions
27 lines (25 loc) · 870 Bytes
/
vite.config.ts
File metadata and controls
27 lines (25 loc) · 870 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
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
const host = process.env.TAURI_DEV_HOST;
// https://vite.dev/config/
export default defineConfig({
plugins: [react()],
// Prevent vite from obscuring Rust errors
clearScreen: false,
server: {
// Tauri expects a fixed port; fail if it's not available
strictPort: true,
host: host || false,
port: 5173,
},
// Env variables starting with TAURI_ are exposed to the client
envPrefix: ['VITE_', 'TAURI_ENV_*'],
build: {
// Tauri uses Chromium on Windows and WebKit on macOS/Linux
target: process.env.TAURI_ENV_PLATFORM === 'windows' ? 'chrome105' : 'safari14',
// Don't minify for debug builds
minify: !process.env.TAURI_ENV_DEBUG ? 'esbuild' : false,
// Produce sourcemaps for debug builds
sourcemap: !!process.env.TAURI_ENV_DEBUG,
},
})