-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvite.config.ts
More file actions
38 lines (37 loc) · 1.12 KB
/
Copy pathvite.config.ts
File metadata and controls
38 lines (37 loc) · 1.12 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
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
export default defineConfig(async () => ({
plugins: [react()],
clearScreen: false,
server: {
port: 5173,
strictPort: true,
watch: {
ignored: ["**/src-tauri/**"],
},
},
envPrefix: ["VITE_", "TAURI_ENV_*"],
build: {
target: "es2022",
minify: process.env.TAURI_ENV_DEBUG ? false : "esbuild",
sourcemap: !!process.env.TAURI_ENV_DEBUG,
rollupOptions: {
output: {
manualChunks: (id) => {
if (id.includes("node_modules/react") || id.includes("node_modules/react-dom")) {
return "react";
}
// Keep the user-gesture-only opener out of the startup Tauri chunk.
// The dialog plugin is loaded eagerly so native file/folder pickers
// cannot fail on a stale late-loaded module after a WebView refresh.
if (id.includes("node_modules/@tauri-apps/plugin-opener")) {
return "tauri-opener";
}
if (id.includes("node_modules/@tauri-apps/")) {
return "tauri";
}
},
},
},
},
}));