From 06f50057811af553aaa7cce90beec572f196a701 Mon Sep 17 00:00:00 2001 From: Fabien JUIF Date: Fri, 10 Nov 2023 21:25:59 +0100 Subject: [PATCH] :sparkles: web build --- Cargo.lock | 20 ++++++++++---------- Makefile | 5 +++++ README.md | 4 ++++ web/index.html | 27 +++++++++++++++++++++++++++ 4 files changed, 46 insertions(+), 10 deletions(-) create mode 100644 web/index.html diff --git a/Cargo.lock b/Cargo.lock index 4c8fb01..f4c4ff2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3432,9 +3432,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.87" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" +checksum = "7daec296f25a1bae309c0cd5c29c4b260e510e6d813c286b19eaadf409d40fce" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -3442,9 +3442,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.87" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" +checksum = "e397f4664c0e4e428e8313a469aaa58310d302159845980fd23b0f22a847f217" dependencies = [ "bumpalo", "log", @@ -3469,9 +3469,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.87" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" +checksum = "5961017b3b08ad5f3fe39f1e79877f8ee7c23c5e5fd5eb80de95abc41f1f16b2" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -3479,9 +3479,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.87" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" +checksum = "c5353b8dab669f5e10f5bd76df26a9360c748f054f862ff5f3f8aae0c7fb3907" dependencies = [ "proc-macro2", "quote", @@ -3492,9 +3492,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.87" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" +checksum = "0d046c5d029ba91a1ed14da14dca44b68bf2f124cfbaf741c54151fdb3e0750b" [[package]] name = "wayland-scanner" diff --git a/Makefile b/Makefile index b5c5ab7..882fd89 100644 --- a/Makefile +++ b/Makefile @@ -11,3 +11,8 @@ release-windows: release-mac-m1: @cross build --target=aarch64-apple-darwin --release + +release-wasm: + @cargo build --release --target wasm32-unknown-unknown + @wasm-bindgen --out-name wasm_game --out-dir target/web/release --target web target/wasm32-unknown-unknown/release/game.wasm + @cp web/* target/web/release/ diff --git a/README.md b/README.md index b813c07..77a6d6d 100644 --- a/README.md +++ b/README.md @@ -14,3 +14,7 @@ rustup target add x86_64-pc-windows-msvc ``` - `make release-windows` + +### Wasm + +https://github.com/bevyengine/bevy/tree/main/examples#setup-2 diff --git a/web/index.html b/web/index.html new file mode 100644 index 0000000..4185c4a --- /dev/null +++ b/web/index.html @@ -0,0 +1,27 @@ + + + + + + +