generated from CubeCraft-Creations/Tracehound
fix: build frontend into the go:embed path so the hub binary compiles
cmd/server/main.go has //go:embed all:src/dist (relative to cmd/server/), but Vite built to repo-root dist/, so cmd/server/src/dist never existed and every `go build` failed with "pattern all:src/dist: no matching files found". The hub binary has never built in CI as a result. - vite.config.ts: outDir -> cmd/server/src/dist (emptyOutDir) - commit cmd/server/src/dist/index.html placeholder so the embed always has a file (real build overwrites it) - .gitignore: scope dist ignore to /dist; ignore cmd/server/src/dist/* but keep the index.html placeholder (the prior !src/dist/index.html rule pointed at the wrong path) - ci.yaml: upload artifact from the new output path Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -5,6 +5,12 @@ import react from '@vitejs/plugin-react'
|
||||
// https://vite.dev/config/
|
||||
export default defineConfig({
|
||||
plugins: [react()],
|
||||
// Build straight into the Go embed location: cmd/server/main.go has
|
||||
// //go:embed all:src/dist relative to its package dir (cmd/server/).
|
||||
build: {
|
||||
outDir: 'cmd/server/src/dist',
|
||||
emptyOutDir: true,
|
||||
},
|
||||
server: {
|
||||
port: 3000,
|
||||
proxy: {
|
||||
|
||||
Reference in New Issue
Block a user