chore: add hot reload for development
- Makefile: add dev-backend (air) and dev-frontend (vite) targets - backend/.air.toml: air config for Go live reload - .gitignore: exclude backend/tmp/
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
.PHONY: build run test clean fmt lint frontend
|
||||
.PHONY: build run test clean fmt lint frontend dev dev-backend dev-frontend
|
||||
|
||||
BINARY_NAME=openteam
|
||||
BUILD_DIR=bin
|
||||
@@ -18,9 +18,17 @@ frontend:
|
||||
run: build
|
||||
./$(BUILD_DIR)/$(BINARY_NAME)
|
||||
|
||||
# Development run
|
||||
dev:
|
||||
cd $(BACKEND_DIR) && go run ./cmd/openteam
|
||||
# Development: backend + frontend (requires air + pnpm)
|
||||
dev: dev-backend dev-frontend
|
||||
|
||||
# Go backend with hot reload (requires: go install github.com/air-verse/air@latest)
|
||||
dev-backend:
|
||||
@command -v air >/dev/null 2>&1 || { echo "Installing air..."; go install github.com/air-verse/air@latest; }
|
||||
cd $(BACKEND_DIR) && air -c .air.toml
|
||||
|
||||
# Vue frontend with HMR
|
||||
dev-frontend:
|
||||
cd frontend && pnpm dev
|
||||
|
||||
# Test
|
||||
test:
|
||||
|
||||
Reference in New Issue
Block a user