build.sh (391B)
1 #!/usr/bin/env bash 2 # Builds the browser bundle into web/dist, which is what gets deployed. 3 set -euo pipefail 4 root=$(cd "$(dirname "$0")/.." && pwd) 5 out="$root/web/dist" 6 mkdir -p "$out" 7 GOOS=js GOARCH=wasm go build -ldflags="-s -w" -o "$out/main.wasm" "$root/cmd/wasm" 8 cp "$(go env GOROOT)/lib/wasm/wasm_exec.js" "$out/wasm_exec.js" 9 cp "$root/web/index.html" "$out/index.html" 10 ls -la "$out"