One-click backups for AT Protocol
1import { defineConfig } from "vite";
2import react from "@vitejs/plugin-react";
3import path from "path";
4import tailwindcss from "@tailwindcss/vite";
5
6const host = process.env.TAURI_DEV_HOST;
7
8// https://vitejs.dev/config/
9export default defineConfig(async () => ({
10 plugins: [react(), tailwindcss()],
11 resolve: {
12 alias: {
13 "@": path.resolve(__dirname, "./src"),
14 },
15 },
16
17 // Vite options tailored for Tauri development and only applied in `tauri dev` or `tauri build`
18 //
19 // 1. prevent vite from obscuring rust errors
20 clearScreen: false,
21 // 2. tauri expects a fixed port, fail if that port is not available
22 server: {
23 port: 1420,
24 strictPort: true,
25 host: host || false,
26 hmr: host
27 ? {
28 protocol: "ws",
29 host,
30 port: 1421,
31 }
32 : undefined,
33 watch: {
34 // 3. tell vite to ignore watching `src-tauri`
35 ignored: ["**/src-tauri/**"],
36 },
37 },
38}));