Feature 01 task 3: Embed the PWA build with SPA fallback #4

2 changed files with 17 additions and 0 deletions
Showing only changes of commit 8236c5e349 - Show all commits
+1
View File
@@ -8,6 +8,7 @@ deploy/secrets/
# Build artifacts and dependencies
node_modules
dist
bin/
# Placeholder so the Go embed compiles on a fresh clone; built assets stay ignored.
!internal/frontend/dist/
internal/frontend/dist/*
+16
View File
@@ -0,0 +1,16 @@
# Build entry point: build the PWA, embed it, then build the server binary.
FRONTEND_DIST := internal/frontend/dist
.PHONY: build web embed
build: embed
go build -o bin/mealquest ./cmd/server
web:
cd web && npm ci && npm run build
# Replace the committed placeholder with the built PWA so go:embed picks it up.
embed: web
rm -rf $(FRONTEND_DIST)/*
cp -R web/dist/. $(FRONTEND_DIST)/