2022-12-27 20:32:29 +03:00
|
|
|
import { defineConfig } from "vite";
|
|
|
|
import { svelte } from "@sveltejs/vite-plugin-svelte";
|
2023-11-08 04:56:21 +03:00
|
|
|
|
2024-08-02 13:35:18 +03:00
|
|
|
const host = process.env.TAURI_DEV_HOST;
|
2022-12-27 20:32:29 +03:00
|
|
|
|
|
|
|
// https://vitejs.dev/config/
|
|
|
|
export default defineConfig({
|
|
|
|
plugins: [svelte()],
|
|
|
|
|
2024-03-11 17:25:20 +03:00
|
|
|
// Vite options tailored for Tauri development and only applied in `tauri dev` or `tauri build`
|
2022-12-27 20:32:29 +03:00
|
|
|
// prevent vite from obscuring rust errors
|
|
|
|
clearScreen: false,
|
|
|
|
// tauri expects a fixed port, fail if that port is not available
|
|
|
|
server: {
|
2024-08-02 16:04:08 +03:00
|
|
|
host: host || false,
|
2022-12-27 20:32:29 +03:00
|
|
|
port: 1420,
|
|
|
|
strictPort: true,
|
2024-08-02 13:35:18 +03:00
|
|
|
hmr: host ? {
|
2023-11-08 04:56:21 +03:00
|
|
|
protocol: 'ws',
|
2024-08-02 16:04:08 +03:00
|
|
|
host,
|
2023-11-08 04:56:21 +03:00
|
|
|
port: 1421
|
|
|
|
} : undefined,
|
2022-12-27 20:32:29 +03:00
|
|
|
},
|
2023-11-08 04:56:21 +03:00
|
|
|
})
|