makefile: integrate build-wasm and compress-wasm

Kim committed Nov 18, 2025 at 16:10 UTC 02e5a84bcccd370d4937930bc935e8bef56b734d
1 file changed +3 -8
Makefile
+3 -8
@@ -8,8 +8,7 @@ help:
8 @echo "Available targets:"
9 @echo " make build - Build everything (protoc, wasm, frontend, server, tunnel)"
10 @echo " make build-protoc - Generate Go code from protobuf definitions"
11 - @echo " make build-wasm - Build WASM client with optimization"
12 - @echo " make compress-wasm - Compress WASM with brotli"
11 + @echo " make build-wasm - Build and compress WASM client with optimization"
12 @echo " make build-frontend - Build React frontend (Tailwind CSS 4)"
13 @echo " make build-server - Build Go relay server (includes frontend build)"
14 @echo " make build-tunnel - Build Portal Tunnel CLI"
@@ -19,8 +18,8 @@ help:
18 run:
19 ./bin/relay-server
20
22 -# Convenience target: build wasm, compress, then server
23 -build: build-protoc build-wasm compress-wasm build-server build-tunnel
21 +# Convenience target
22 +build: build-wasm build-frontend build-server build-tunnel
23
24 build-protoc:
25 protoc -I . \
@@ -60,12 +59,8 @@ build-wasm:
59 @cp cmd/webclient/service-worker.js cmd/relay-server/dist/service-worker.js
60 @cp cmd/webclient/index.html cmd/relay-server/dist/portal.html
61 @cp cmd/webclient/portal.mp4 cmd/relay-server/dist/portal.mp4
63 -
62 @echo "[wasm] build complete"
65 - @make compress-wasm
63
67 -# Precompress content-addressed WASM with brotli
68 -compress-wasm:
64 @echo "[wasm] precompressing webclient WASM with brotli..."
65 @WASM_FILE=$$(ls cmd/relay-server/dist/[0-9a-f]*.wasm 2>/dev/null | head -n1); \
66 if [ -z "$$WASM_FILE" ]; then \