Open History to see the last commit
1import tailwindcss from "@tailwindcss/vite";
2import react from "@vitejs/plugin-react";
3import { defineConfig } from "vite";
4
5const port = Number(process.env.PORT ?? 5173);
6
7export default defineConfig({
8 plugins: [
9 react({
10 babel: {
11 plugins: [["babel-plugin-react-compiler", { target: "19" }]],
12 },
13 }),
14 tailwindcss(),
15 ],
16 define: {
17 // In dev mode, tell the web app where the WebSocket server lives
18 "import.meta.env.VITE_WS_URL": JSON.stringify(process.env.VITE_WS_URL ?? ""),
19 },
20 experimental: {
21 enableNativePlugin: true,
22 },
23 resolve: {
24 tsconfigPaths: true,
25 },
26 server: {
27 port,
28 strictPort: true,
29 hmr: {
30 // Explicit config so Vite's HMR WebSocket connects reliably
31 // inside Electron's BrowserWindow. Vite 8 uses console.debug for
32 // connection logs — enable "Verbose" in DevTools to see them.
33 protocol: "ws",
34 host: "localhost",
35 },
36 },
37 build: {
38 outDir: "dist",
39 emptyOutDir: true,
40 },
41});