summaryrefslogtreecommitdiff
path: root/crates/gipfel-wasm/build.sh
blob: 8d1d812e54da229783ca7b4b263d405e8ae007d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh
# Build the gipfel WASM spike and serve the demo page.
# Requires: rustup (for the wasm target) and wasm-pack.
set -e
cd "$(dirname "$0")"

if ! rustup target list --installed 2>/dev/null | grep -q wasm32-unknown-unknown; then
	echo "adding wasm32-unknown-unknown target ..."
	rustup target add wasm32-unknown-unknown
fi
command -v wasm-pack >/dev/null 2>&1 || {
	echo "wasm-pack not found. Install it once with:"
	echo "  cargo install wasm-pack    (or: cargo binstall wasm-pack)"
	exit 1
}

wasm-pack build --target web

echo
echo "built. serve the demo with:"
echo "  (cd crates/gipfel-wasm && python3 -m http.server 8080)"
echo "then open  http://localhost:8080/demo/"