32 lines
1.1 KiB
JavaScript
32 lines
1.1 KiB
JavaScript
import { defineConfig } from "vite";
|
|
import { svelte } from "@sveltejs/vite-plugin-svelte";
|
|
|
|
export default defineConfig({
|
|
plugins: [svelte()],
|
|
clearScreen: false,
|
|
build: {
|
|
rollupOptions: {
|
|
// Two documents, one app: the full shell and the mini player
|
|
// window load the same modules through different mount points.
|
|
input: {
|
|
main: "index.html",
|
|
mini: "mini.html",
|
|
},
|
|
},
|
|
},
|
|
server: {
|
|
port: 1421,
|
|
strictPort: true,
|
|
// Bind IPv4 loopback explicitly. With no host, Vite on modern Node
|
|
// binds [::1] ONLY, while WebView2 resolves the devUrl's "localhost"
|
|
// to 127.0.0.1 — so the window opens on ERR_CONNECTION_REFUSED while
|
|
// curl and the browser (which try ::1) both say the server is fine.
|
|
host: "127.0.0.1",
|
|
watch: {
|
|
// Never watch the Rust build dir: cargo locks files mid-compile,
|
|
// which crashes Vite's watcher (EBUSY) and kills tauri dev.
|
|
ignored: ["**/src-tauri/**", "**/crates/**", "**/target/**"],
|
|
},
|
|
},
|
|
});
|