26 lines
571 B
TypeScript
26 lines
571 B
TypeScript
import { defineConfig } from "vite";
|
|
import react from "@vitejs/plugin-react";
|
|
|
|
// Tauri dev server host (set by the CLI when using --host)
|
|
const host = process.env.TAURI_DEV_HOST;
|
|
|
|
export default defineConfig({
|
|
plugins: [react()],
|
|
|
|
// Prevent Vite from obscuring Rust errors
|
|
clearScreen: false,
|
|
|
|
server: {
|
|
port: 1420,
|
|
strictPort: true,
|
|
host: host || false,
|
|
hmr: host
|
|
? { protocol: "ws", host, port: 1421 }
|
|
: undefined,
|
|
watch: {
|
|
// Tell Vite to ignore watching `src-tauri`
|
|
ignored: ["**/src-tauri/**"],
|
|
},
|
|
},
|
|
});
|