From 21b6cc192df4add5641ab56d51f8b6925ca376a5 Mon Sep 17 00:00:00 2001 From: hut Date: Thu, 4 Apr 2024 03:20:38 +0200 Subject: [PATCH] add preliminary instructions on how to build for web assembly --- README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/README.md b/README.md index 4385fbe..21b19cb 100644 --- a/README.md +++ b/README.md @@ -118,6 +118,23 @@ cd outfly cargo run --release ``` +## Building for WASM/Browser + +This is a work in progress, for now these are just some general hints: + +``` +git clone [URL] +cd outfly +rustup target install wasm32-unknown-unknown +pacman -S wasm-bindgen binaryen +mkdir outfly_wasm +cargo build --release --target wasm32-unknown-unknown +wasm-bindgen --out-name outfly --out-dir outfly_wasm --target web target/wasm32-unknown-unknown/release/outfly.wasm +wasm-opt -Oz --output wasm/outfly_bg.wasm wasm/outfly_bg.wasm +echo '' > wasm/index.html +python -m http.server -d wasm +``` + # Changelog - v0.5.2: