aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/ui/vite.config.ts
blob: 32610e26462819cbc40ff640802f8445a4d7e753 (plain) (blame)
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
import { defineConfig } from "vite";
import { svelte } from "@sveltejs/vite-plugin-svelte";
import tailwindcss from "@tailwindcss/vite";

// https://vite.dev/config/
export default defineConfig({
  plugins: [tailwindcss(), svelte()],

  // Fix for Tauri + Vite HMR
  server: {
    host: true,
    strictPort: true,
    hmr: {
      protocol: "ws",
      host: "localhost",
      port: 5173,
    },
    watch: {
      usePolling: true,
    },
  },

  // Ensure compatibility with Tauri
  clearScreen: false,
  envPrefix: ["VITE_", "TAURI_"],
});