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