mirror of
https://github.com/BillyOutlast/gsd-pi-config.git
synced 2026-07-01 08:34:05 -04:00
4aed376576
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>
43 lines
1021 B
TypeScript
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"],
|
|
},
|
|
};
|
|
});
|