Files
t3code/apps/web/vite.config.ts
Julius Marminge 3421049d5c Add remote backend connection support across server and clients
- document remote architecture and setup in `REMOTE.md` and link from README
- add server host override and WebSocket bearer-token auth support
- enable web runtime/env remote WS config and desktop remote mode without local spawn
- extend WS tests for bearer authorization path
2026-02-18 09:00:49 -08:00

43 lines
1.1 KiB
TypeScript

import tailwindcss from "@tailwindcss/vite";
import react from "@vitejs/plugin-react";
import { defineConfig } from "vite";
const port = Number(process.env.PORT ?? 5173);
export default defineConfig({
plugins: [
react({
babel: {
plugins: [["babel-plugin-react-compiler", { target: "19" }]],
},
}),
tailwindcss(),
],
define: {
// In dev mode, tell the web app where the WebSocket server lives
"import.meta.env.VITE_WS_URL": JSON.stringify(process.env.VITE_WS_URL ?? ""),
"import.meta.env.VITE_WS_TOKEN": JSON.stringify(process.env.VITE_WS_TOKEN ?? ""),
},
experimental: {
enableNativePlugin: true,
},
resolve: {
tsconfigPaths: true,
},
server: {
port,
strictPort: true,
hmr: {
// Explicit config so Vite's HMR WebSocket connects reliably
// inside Electron's BrowserWindow. Vite 8 uses console.debug for
// connection logs — enable "Verbose" in DevTools to see them.
protocol: "ws",
host: "localhost",
},
},
build: {
outDir: "dist",
emptyOutDir: true,
},
});