- Go module + chi server with embedded SPA serving and /api/health - internal/config env loader (local-dev defaults; auth/copyleaks deferred) - React 19 + Vite 6 + Tailwind v4 frontend with full Petal design tokens - Frontend embedded into the binary via web/embed.go (go:embed all:dist) - README dev workflow, .env.example, BUILD_PLAN progress tracker - Verified end-to-end: binary serves health, embedded SPA, and SPA fallback
22 lines
675 B
TypeScript
22 lines
675 B
TypeScript
import { defineConfig } from 'vite'
|
|
import react from '@vitejs/plugin-react'
|
|
import tailwindcss from '@tailwindcss/vite'
|
|
|
|
// Dev: Vite serves the UI on :5173 and proxies /api to the Go backend on :8080.
|
|
// Prod: `vite build` emits web/dist, which the Go binary embeds and serves itself.
|
|
export default defineConfig({
|
|
plugins: [react(), tailwindcss()],
|
|
server: {
|
|
port: 5173,
|
|
proxy: {
|
|
'/api': 'http://localhost:8080',
|
|
},
|
|
},
|
|
build: {
|
|
outDir: 'dist',
|
|
// Keep false so the committed dist/.gitkeep placeholder survives builds —
|
|
// it's what lets `go build` compile on a fresh clone before any frontend build.
|
|
emptyOutDir: false,
|
|
},
|
|
})
|