From 22573701f475b50ce307d059faa68a701506bc4b Mon Sep 17 00:00:00 2001 From: Johan Brandhorst Date: Tue, 30 Apr 2019 15:51:11 +0100 Subject: [PATCH] Fix tinygo JS example --- Makefile | 1 + README.md | 11 ++++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index a7e3ec5..db3f309 100644 --- a/Makefile +++ b/Makefile @@ -12,6 +12,7 @@ tinygo: clean cp /usr/local/tinygo/targets/wasm_exec.js ./html/wasm_exec.js\ " cp $$(go env GOROOT)/misc/wasm/wasm_exec.html ./html/index.html + sed -i -e 's;;\n\t
;' ./html/index.html .PHONY: channels channels: clean diff --git a/README.md b/README.md index edf7ea8..6f4d94c 100644 --- a/README.md +++ b/README.md @@ -38,13 +38,13 @@ serve as usual. For example: ```bash $ make tinygo target=hello -rm -f ./html/* -docker run --rm -v $(pwd):/go/src/github.com/johanbrandhorst/wasm-experiments --entrypoint /bin/bash tinygo/tinygo:latest -c "\ +docker run --rm -v $$(pwd):/go/src/github.com/johanbrandhorst/wasm-experiments tinygo/tinygo:0.5.0 /bin/bash -c "\ cd /go/src/github.com/johanbrandhorst/wasm-experiments && \ - tinygo build -o ./html/test.wasm -target wasm ./hello/main.go && \ - cp /go/src/github.com/tinygo-org/tinygo/targets/wasm_exec.js ./html/wasm_exec.js\ + tinygo build -o ./html/test.wasm -target wasm --no-debug ./hello/main.go && \ + cp /usr/local/tinygo/targets/wasm_exec.js ./html/wasm_exec.js\ " -cp $(go env GOROOT)/misc/wasm/wasm_exec.html ./html/index.html +cp $$(go env GOROOT)/misc/wasm/wasm_exec.html ./html/index.html +sed -i -e 's;;\n\t
;' ./html/index.html $ make serve go run main.go 2019/02/24 14:33:58 Serving on http://localhost:8080 @@ -56,6 +56,7 @@ TinyGo: - `hello` - `channels` +- `js` ## Experiments