fix: build

This commit is contained in:
2026-04-28 22:09:19 -04:00
parent fcfa43cca3
commit 4c1523d81b
9 changed files with 60 additions and 20 deletions

View File

@@ -1,14 +1,22 @@
.PHONY: all frontend backend clean dev docker docker-run tests
.PHONY: all frontend backend clean dev docker docker-run tests check-static
all: frontend backend
frontend:
rm -rf frontend/public/dist
cd frontend && bun run build
rm -rf backend/web/static
mkdir -p backend/web/static
cp frontend/public/index.html backend/web/static/ 2>/dev/null || true
cp -r frontend/public/pages backend/web/static/ 2>/dev/null || true
cp -R frontend/public/. backend/web/static/
find backend/web/static -type d -empty -delete
touch backend/web/static/.gitkeep
backend:
check-static:
@test -f backend/web/static/index.html || (echo "missing backend/web/static/index.html; run 'make frontend' first" && exit 1)
@test -f backend/web/static/dist/main.js || (echo "missing backend/web/static/dist/main.js; run 'make frontend' first" && exit 1)
@test -f backend/web/static/dist/styles.css || (echo "missing backend/web/static/dist/styles.css; run 'make frontend' first" && exit 1)
backend: check-static
cd backend && go build -o ./dist/aethera ./cmd
clean:
@@ -17,7 +25,11 @@ clean:
rm -rf backend/web/static
dev:
cd backend && go run ./cmd --listen 0.0.0.0 &
rm -rf frontend/public/dist
cd frontend && bun run build
cd backend && AETHERA_STATIC_DIR=../frontend/public go run ./cmd --listen 0.0.0.0 & \
backend_pid=$$!; \
trap 'kill $$backend_pid' INT TERM EXIT; \
cd frontend && bun run dev
docker: