Skip to content

lloydlobo/hexed

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

:q

hexed

Deploy Pages

preview

Build

  • First, compile Go code to WebAssembly:

    GOOS=js GOARCH=wasm go build -o main.wasm main.go
  • Copy the WebAssembly JavaScript support file from local Go installation:

    cp "$(go env GOROOT)/lib/wasm/wasm_exec.js" .
    # or
    cp "$(go env GOROOT)/misc/wasm/wasm_exec.js" .

    See https://go.dev/wiki/WebAssembly guide.

  • Final directory structure should look like:

    app/
    ├── index.html
    ├── main.wasm
    └── wasm_exec.js
  • Push these files to GitHub/GitLab and enable Pages.

Develop

find -name '*go' -or -name '*.html' -or -name '*.js' | entr -crs "GOOS=js GOARCH=wasm go build -o main.wasm main.go; python -m http.server"

Thanks

Related