Files
Jeremy McSpadden 4aed376576 Fix Vercel blank page by building web assets at root path.
Use .env.web and vercel build env for VITE_BASE_PATH=/; trim README deploy
section. GitHub Pages CI still overrides base to /gsd-pi-config/.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-25 11:27:28 -05:00

43 lines
1021 B
TypeScript

// GSD Pi Config - Vite Configuration
// Copyright (c) 2026 Jeremy McSpadden <jeremy@fluxlabs.net>
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import tailwindcss from "@tailwindcss/vite";
export default defineConfig(({ mode }) => {
const isWeb = mode === "web";
return {
plugins: [react(), tailwindcss()],
clearScreen: false,
base: isWeb ? (process.env.VITE_BASE_PATH ?? "/") : "/",
define: {
"import.meta.env.VITE_PLATFORM": JSON.stringify(isWeb ? "web" : "desktop"),
},
build: {
outDir: "dist",
emptyOutDir: true,
},
server: {
port: isWeb ? 5173 : 1420,
strictPort: true,
watch: {
ignored: ["**/src-tauri/**"],
},
proxy: isWeb
? {
"/api": {
target: "http://127.0.0.1:3000",
changeOrigin: true,
},
}
: undefined,
},
test: {
environment: "node",
include: ["src/**/*.test.ts"],
},
};
});