2026-09-23 17:05:50 +00:00
|
|
|
import { fileURLToPath } from "node:url";
|
2026-02-27 04:29:51 +00:00
|
|
|
import { defineConfig } from "vite";
|
|
|
|
|
import react from "@vitejs/plugin-react";
|
|
|
|
|
import tailwindcss from "@tailwindcss/vite";
|
|
|
|
|
|
|
|
|
|
const host = process.env.TAURI_DEV_HOST;
|
|
|
|
|
|
|
|
|
|
export default defineConfig({
|
|
|
|
|
plugins: [react(), tailwindcss()],
|
|
|
|
|
clearScreen: false,
|
|
|
|
|
server: {
|
|
|
|
|
port: 1420,
|
|
|
|
|
strictPort: true,
|
|
|
|
|
host: host || false,
|
|
|
|
|
hmr: host
|
|
|
|
|
? {
|
|
|
|
|
protocol: "ws",
|
|
|
|
|
host,
|
|
|
|
|
port: 1421,
|
|
|
|
|
}
|
|
|
|
|
: undefined,
|
|
|
|
|
watch: {
|
|
|
|
|
ignored: ["**/src-tauri/**"],
|
|
|
|
|
},
|
|
|
|
|
},
|
2026-09-23 17:05:50 +00:00
|
|
|
build: {
|
|
|
|
|
rollupOptions: {
|
|
|
|
|
input: {
|
|
|
|
|
main: fileURLToPath(new URL("index.html", import.meta.url)),
|
|
|
|
|
viewer: fileURLToPath(new URL("viewer.html", import.meta.url)),
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
2026-02-27 04:29:51 +00:00
|
|
|
});
|