d90dda1df5
`npm run tauri dev` died before the window opened: Vite's watcher crashed with EBUSY on target\debug\deps\odian_launcher_lib.dll. Root cause: the Cargo workspace builds into target/ at the repo root, not under src-tauri/, and vite.config.ts only excluded src-tauri - so Vite watched the DLLs the Rust build holds locked. Spot-check: a fresh clone, `npm install`, `npm run tauri dev` opens the launcher window instead of "beforeDevCommand terminated".
24 lines
749 B
TypeScript
24 lines
749 B
TypeScript
import { defineConfig } from "vite";
|
|
import { svelte } from "@sveltejs/vite-plugin-svelte";
|
|
|
|
// Tauri loads the dev server from a fixed port and fails if it is taken, and
|
|
// rebuilds the Rust side itself, so Vite must not watch src-tauri - nor the
|
|
// workspace's target/ at the repo root, whose DLLs the build holds locked
|
|
// (watching one crashes Vite with EBUSY).
|
|
export default defineConfig({
|
|
plugins: [svelte()],
|
|
clearScreen: false,
|
|
server: {
|
|
port: 1420,
|
|
strictPort: true,
|
|
watch: { ignored: ["**/src-tauri/**", "**/target/**"] },
|
|
},
|
|
envPrefix: ["VITE_", "TAURI_ENV_"],
|
|
build: {
|
|
// WebView2 is evergreen Chromium on every supported Windows.
|
|
target: "chrome110",
|
|
outDir: "dist",
|
|
emptyOutDir: true,
|
|
},
|
|
});
|