-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
44 lines (39 loc) · 1.12 KB
/
vite.config.ts
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
import { URL, fileURLToPath } from "node:url";
import autoPrefixer from "autoprefixer";
import { defineConfig } from "vite";
import icons from "unplugin-icons/vite";
import postcssPresetEnv from "postcss-preset-env";
import vue from "@vitejs/plugin-vue";
export default defineConfig(async () => ({
plugins: [vue(), icons({ compiler: "vue3" })],
clearScreen: false,
server: {
host: "127.0.0.1",
port: 1420,
strictPort: true,
},
envPrefix: ["VITE_", "TAURI_ENV_*"],
css: {
postcss: {
plugins: [postcssPresetEnv, autoPrefixer],
},
},
resolve: {
alias: {
"@": fileURLToPath(new URL("./src", import.meta.url)),
},
},
build: {
// Tauri uses Edge on Windows and WebKit on macOS and Linux
target:
process.env.TAURI_ENV_PLATFORM === "windows" ? "edge105" : "safari13",
// 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,
},
define: {
// Remove Vue Options API support for memory consumption.
__VUE_OPTIONS_API__: false,
},
}));