WIP WASM build of Tableland's sqlparser
I use the Rust https
package because it handles the correct MIME types for
served files.
brew tap tinygo-org/tools
brew install tinygo
go get -u github.com/gonowa/wasm-opt
cargo install https
Use the corresponding tinygo version
wget https://raw.githubusercontent.com/tinygo-org/tinygo/v0.23.0/targets/wasm_exec.js
tinygo build -wasm-abi=generic -gc=leaking -no-debug -o main.wasm -target wasm ./main.go
wasm-opt -O main.wasm -o main.wasm
This will produce main.wasm
, and should be no more than 425K in size.
You can use whatever file server you want here, just make sure the wasm file is served as application/wasm
.
httplz