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