@@ -30,7 +30,7 @@ GATEWAY_DOCKER_IMAGE ?= liveagent-gateway:local
3030RELEASE_TAG ?=
3131
3232.PHONY : all dev build desktop-build-macos desktop-build-macos-release desktop-build-macos-intel desktop-build-macos-m desktop-build-windows desktop-build-linux github-release-main check-github-release-tag help
33- .PHONY : dev-gateway dev-webui
33+ .PHONY : dev-gateway dev-webui ensure-webui-embed-stub
3434.PHONY : proto proto-check webui gateway-build gateway-docker-build gateway-docker-run gateway-docker-smoke build-linux build-linux-amd build-linux-arm
3535.PHONY : clean check-rust-target-% check-macos-signing-identity check-macos-notary-profile desktop-store-macos-notary-profile desktop-wait-macos-notary desktop-staple-macos desktop-verify-macos
3636
@@ -106,12 +106,27 @@ check-github-release-tag:
106106 @node scripts/release/prepare-app-version-from-tag.mjs " $( RELEASE_TAG) " --json > /dev/null
107107
108108# # Gateway development
109- dev-gateway :
109+ # go:embed requires web/dist at compile time. Dev serves the SPA from Vite, so
110+ # a tiny stub is enough to let `go run` start without a full WebUI build.
111+ dev-gateway : ensure-webui-embed-stub
110112 go -C $(AGENT_GATEWAY_DIR ) run ./cmd/gateway --token=$(DEV_GATEWAY_TOKEN ) --http-addr=$(DEV_GATEWAY_HTTP_ADDR )
111113
112114dev-webui :
113115 npm_config_proxy_api=$(DEV_WEBUI_PROXY_API ) pnpm --dir $(AGENT_GATEWAY_WEB_DIR ) dev
114116
117+ ensure-webui-embed-stub :
118+ @if [ ! -f " $( AGENT_GATEWAY_WEB_DIR) /dist/index.html" ]; then \
119+ mkdir -p " $( AGENT_GATEWAY_WEB_DIR) /dist" ; \
120+ printf ' %s\n' \
121+ ' <!doctype html>' \
122+ ' <html lang="en">' \
123+ ' <head><meta charset="utf-8"><title>LiveAgent Gateway</title></head>' \
124+ ' <body><p>WebUI embed stub. Run <code>make dev-webui</code> for the real SPA.</p></body>' \
125+ ' </html>' \
126+ > " $( AGENT_GATEWAY_WEB_DIR) /dist/index.html" ; \
127+ echo " created $( AGENT_GATEWAY_WEB_DIR) /dist stub for go:embed" ; \
128+ fi
129+
115130# # Gateway build and generated assets
116131proto :
117132 @command -v buf > /dev/null || (echo " buf is required. Run: mise install" && exit 1)
0 commit comments