panorama/ui/vite.config.ts

29 lines
730 B
TypeScript
Raw Permalink Normal View History

2024-05-28 04:01:41 +00:00
import { defineConfig, type PluginOption } from "vite";
2024-05-25 10:04:05 +00:00
import react from "@vitejs/plugin-react";
2024-05-28 04:01:41 +00:00
import { visualizer } from "rollup-plugin-visualizer";
2023-11-13 18:04:06 +00:00
// https://vitejs.dev/config/
export default defineConfig(async () => ({
2024-05-28 04:01:41 +00:00
plugins: [
react(),
visualizer({
emitFile: true,
filename: "stats.html",
}) as PluginOption,
],
2023-11-13 18:04:06 +00:00
2024-05-28 04:01:41 +00:00
// 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,
watch: {
// 3. tell vite to ignore watching `src-tauri`
ignored: ["**/src-tauri/**"],
},
},
2023-11-13 18:04:06 +00:00
}));