Files
coding-bench/vite.config.js
wlkns-dev 57fbc57a54 feat: Tauri-2-Gerüst mit Svelte und TypeScript anlegen
create-tauri-app, Template svelte-ts. npm run build und cargo check laufen
durch. App nicht gestartet, Datenordner und TOML-Config folgen (#1018).

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
2026-11-06 18:37:40 +01:00

33 lines
875 B
JavaScript

import { defineConfig } from "vite";
import { sveltekit } from "@sveltejs/kit/vite";
// @ts-expect-error type error without @types/node package
import process from "node:process";
const host = process.env.TAURI_DEV_HOST;
// https://vite.dev/config/
export default defineConfig(() => ({
plugins: [sveltekit()],
// Vite options tailored for Tauri development and only applied in `tauri dev` or `tauri build`
//
// 1. prevent Vite from obscuring rust errors
clearScreen: false,
// 2. tauri expects a fixed port, fail if that port is not available
server: {
port: 1420,
strictPort: true,
host: host || "127.0.0.1",
hmr: host
? {
protocol: "ws",
host,
port: 1421,
}
: undefined,
watch: {
// 3. tell Vite to ignore watching `src-tauri`
ignored: ["**/src-tauri/**"],
},
},
}));