From fe573a413675451d1e97901320834359a22fe164 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Wed, 8 Jan 2025 14:27:20 +0900 Subject: [PATCH] contents/en/documents/webassembly: fix the location of wasm_exec.js --- contents/en/documents/webassembly.html | 11 ++++++++++- contents/ja/documents/webassembly.html | 11 ++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/contents/en/documents/webassembly.html b/contents/en/documents/webassembly.html index a0c91c5..675c52f 100644 --- a/contents/en/documents/webassembly.html +++ b/contents/en/documents/webassembly.html @@ -16,9 +16,18 @@

Compiling your game

Remove-Item Env:GOARCH

Copying wasm_exec.js to execute the WebAssembly binary

On a Unix/Linux shell:

-
cp $(go env GOROOT)/misc/wasm/wasm_exec.js .
+
# Go 1.24 and newer
+cp $(go env GOROOT)/lib/wasm/wasm_exec.js .
+
+# Go 1.23 and older
+cp $(go env GOROOT)/misc/wasm/wasm_exec.js .

On Windows PowerShell:

$goroot = go env GOROOT
+
+# Go 1.24 and newer
+cp $goroot\lib\wasm\wasm_exec.js .
+
+# Go 1.23 and older
 cp $goroot\misc\wasm\wasm_exec.js .

Creating an HTML

Create this HTML:

diff --git a/contents/ja/documents/webassembly.html b/contents/ja/documents/webassembly.html index 8db3ae5..455654b 100644 --- a/contents/ja/documents/webassembly.html +++ b/contents/ja/documents/webassembly.html @@ -16,9 +16,18 @@

ゲームのコンパイル

Remove-Item Env:GOARCH

WebAssembly バイナリを実行するための wasm_exec.js のコピー

Unix/Linux シェルの場合:

-
cp $(go env GOROOT)/misc/wasm/wasm_exec.js .
+
# Go 1.24 以後
+cp $(go env GOROOT)/lib/wasm/wasm_exec.js .
+
+# Go 1.23 以前
+cp $(go env GOROOT)/misc/wasm/wasm_exec.js .

Windows PowerShell の場合:

$goroot = go env GOROOT
+
+# Go 1.24 以後
+cp $goroot\lib\wasm\wasm_exec.js .
+
+# Go 1.23 以前
 cp $goroot\misc\wasm\wasm_exec.js .

HTML の作成

次のような HTML を作成してください: