build.sh (421B)
1 #!/bin/bash 2 3 if [ -z "$(which tinygo)" ]; then 4 echo "Warning: tinygo not found! Building .wasm with go" 5 cp "$(go env GOROOT)/misc/wasm/wasm_exec.js" public/wasm_exec.js 6 GOOS=js GOARCH=wasm go build -o public/app.wasm . & 7 else 8 echo "Building .wasm with tinygo" 9 cp "$(tinygo env TINYGOROOT)/targets/wasm_exec.js" public/wasm_exec.js 10 tinygo build -o public/app.wasm -target wasm . & 11 fi 12 npm run build