-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
73 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
#!/bin/bash -ex | ||
# Note that this hack keeps changing for every release of Go. | ||
# This script is currently for use with Go 1.15.1: | ||
cat $(go env GOROOT)/misc/wasm/wasm_exec.js | | ||
sed -e 's/global.require.main === module/false/' \ | ||
-e 's/global.fs = require.*$/try { & } catch (err) {}/' \ | ||
-e 's/const fs = require.*$/try { &/' \ | ||
-e 's/global.fs = fs;/& } } catch (err) {} {/' \ | ||
> js/wasm_exec.js | ||
# tinygo 0.12.0 doesn't build this app without errors. Use the Go compiler instead. | ||
# tinygo 0.14.1 doesn't build this app without errors. Use the Go compiler instead. | ||
# tinygo build -o main.wasm -target wasm . | ||
GOARCH=wasm GOOS=js go build -o main.wasm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters