Files
beardrive/internal/webapp/frontend/vite.config.ts
Snow LeeandClaude Fable 5 e701555257 feat(webapp): [phase 0] React+TS frontend scaffold, build pipeline, e2e harness
- Vite+React+TypeScript workspace at internal/webapp/frontend; vite build
  emits committed assets into internal/webapp/static (the go:embed target),
  so plain 'go build' still needs no Node
- style.css and the SVG sprite ported verbatim; boot layer (api/config,
  401->login redirect) ported so the auth flow works end to end
- frontend(): content-hashed assets/* now served immutable; index.html
  stays no-cache (TestFrontendSPAFallback covers both)
- committed e2e harness (BDRIVE_E2E_SERVE=1, deterministic seeded hub on
  :8993) wired as Playwright webServer; 4 shell specs green
- check-dist.sh guards against stale committed build output

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P5cxPQdSGJnjXCYY9GeWXt
2026-07-13 09:57:14 -07:00

24 lines
799 B
TypeScript

import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
// Build output feeds the Go binary: ../static is the go:embed target in
// server.go, and the compiled assets are committed so plain `go build`
// needs no Node. Run ./check-dist.sh to verify the committed output is
// fresh.
// Dev target: a locally running hub (`bdrive web` or the e2e harness).
const target = process.env.BDRIVE_DEV_PROXY || "http://localhost:8080";
export default defineConfig({
plugins: [react()],
build: { outDir: "../static", emptyOutDir: true },
server: {
proxy: {
// Everything the Go server owns; the frontend itself only ever uses
// root-absolute URLs, so prefix proxying is enough.
"/api": target,
"/auth": target,
"^/s/": target,
},
},
});