-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathvite.config.ts
More file actions
34 lines (28 loc) · 925 Bytes
/
vite.config.ts
File metadata and controls
34 lines (28 loc) · 925 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
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
// Use relative paths for Tauri's file:// protocol
base: './',
// Vite options tailored for Tauri development
clearScreen: false,
server: {
port: 1420,
strictPort: true,
watch: {
// Tell vite to ignore watching `src-tauri`
ignored: ["**/src-tauri/**"],
},
},
// Environment variables starting with TAURI_ will be exposed
envPrefix: ["VITE_", "TAURI_"],
build: {
// Tauri uses Chromium on Windows and WebKit on macOS and 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,
},
});