From 1bdc9194042216d9218ba24d6a5332643e981f7c Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Tue, 28 Aug 2018 00:27:40 +0900 Subject: [PATCH] Updated WebAssembly (markdown) --- WebAssembly.md | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/WebAssembly.md b/WebAssembly.md index 5e6bb27..ea50b68 100644 --- a/WebAssembly.md +++ b/WebAssembly.md @@ -1,4 +1,4 @@ -~The easiest way is to use [WasmServe](https://github.com/hajimehoshi/wasmserve) with the latest Go.~ WasmServe doesn't work well with modules. Stay tuned! +The easiest way is to use [WasmServe](https://github.com/hajimehoshi/wasmserve) with the latest Go. This article introduces a regular way to build an Ebiten app as a WebAssembly port. @@ -7,13 +7,24 @@ This article introduces a regular way to build an Ebiten app as a WebAssembly po * Go 1.11 * Ebiten master branch (1.8.0-alpha.0.XXX) / 2.0.0-alpha -# Compile your game +# 1. WasmServe + +```sh +cd yourgame +wasmserve +``` + +Then access `http://localhost:8080/`. + +# 2. Regular + +## Compile your game ```sh GOOS=js GOARCH=wasm go build -o yourgame.wasm github.com/yourname/yourgame ``` -# Copy `wasm_exec.js` to execute the Wasm binary +## Copy `wasm_exec.js` to execute the Wasm binary ```sh cp $GOROOT/misc/wasm/wasm_exec.js .