β οΈ looking for maintainers (dm @v_1rtl on telegram or email to v1rtl@proton.me)
Simple CLI for setting up Go WebAssembly frontend app.
- π οΈ Dev Server with live reload
- ποΈ TinyGo for small WebAssembly output
- β‘ Git setup with files (such as
README.md
) - π©Ή Glue files (
index.html
+wasm_exec.js
)
- Go 1.12+
- Browser that supports WebAssembly
lld
(LLVM linker)
go get github.com/talentlessguy/go-web-app
Then use as go-web-app
.
Initialize a project in a picked directory.
out.wasm
is generated when building. Other files are automatically added.
βββ src
β βββ main.go
βββ build
β βββ out.wasm
βββ go.mod
βββ index.html
βββ README.md
βββ wasm_exec.js
Builds the project on first run and launches a development server with specified port.
Default port is 8080.
After launching a server, you should go to http://localhost:<port>
Every time you change a file in src
dev server automatically compiles and updates the page.
Compiles go code to WebAssembly. Compiled out.wasm
file could be found in build
folder.
Everything in src
compiles to build
, every go file.
After build, binary size is shown