Add audio nodes to the patch bay
Also make the patch bay responsive.
This commit is contained in:
47
build-web.sh
Executable file
47
build-web.sh
Executable file
@@ -0,0 +1,47 @@
|
||||
#!/usr/bin/env bash
|
||||
# Build the synth-visualiser WASM package and place it in www/pkg/.
|
||||
#
|
||||
# Usage:
|
||||
# ./build-web.sh # release build (optimised)
|
||||
# ./build-web.sh --dev # dev build (faster, no wasm-opt)
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
cd "$SCRIPT_DIR"
|
||||
|
||||
# ── Argument parsing ──────────────────────────────────────────────────────────
|
||||
MODE="release"
|
||||
WASM_PACK_PROFILE="--release"
|
||||
for arg in "$@"; do
|
||||
case "$arg" in
|
||||
--dev) MODE="dev"; WASM_PACK_PROFILE="--dev" ;;
|
||||
--help) echo "Usage: $0 [--dev]"; exit 0 ;;
|
||||
*) echo "Unknown argument: $arg"; exit 1 ;;
|
||||
esac
|
||||
done
|
||||
|
||||
# ── Preflight checks ──────────────────────────────────────────────────────────
|
||||
if ! command -v wasm-pack &>/dev/null; then
|
||||
echo "error: wasm-pack not found. Install it with:"
|
||||
echo " cargo install wasm-pack"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! rustup target list --installed | grep -q "wasm32-unknown-unknown"; then
|
||||
echo "Adding wasm32-unknown-unknown target..."
|
||||
rustup target add wasm32-unknown-unknown
|
||||
fi
|
||||
|
||||
# ── Build ─────────────────────────────────────────────────────────────────────
|
||||
echo "Building synth-visualiser ($MODE)..."
|
||||
wasm-pack build crates/synth-visualiser \
|
||||
$WASM_PACK_PROFILE \
|
||||
--target web \
|
||||
--out-dir ../../www/pkg
|
||||
|
||||
echo ""
|
||||
echo "Done. Serve with:"
|
||||
echo " npx serve www"
|
||||
echo " or"
|
||||
echo " python3 -m http.server --directory www 8080"
|
||||
Reference in New Issue
Block a user