Files
launcher/scripts/build-web.sh
T
nandi 2fa7bd745b
Launcher / test (push) Successful in 1m20s
Launcher / apk (push) Successful in 37s
Rewrite the launcher in MoonBit (old code moves to legacy/) (#1)
2026-11-23 01:57:10 +00:00

15 lines
658 B
Bash
Executable File

#!/usr/bin/env bash
# Builds the page: the MoonBit program (web/*.mbt, js backend) plus its static files,
# into dist/web/. With --demo the browser demo's apps.json and widgets.json come too;
# the APK build leaves them out (the shell answers those URLs itself).
set -euo pipefail
cd "$(dirname "$0")/.."
export PATH="$HOME/.moon/bin:$PATH"
moon build --target js --release
out=dist/web
rm -rf "$out" && mkdir -p "$out"
cp _build/js/release/build/web/web.js "$out/launcher.js"
cp web/index.html web/style.css "$out/"
if [ "${1:-}" = "--demo" ]; then cp web/apps.json web/widgets.json "$out/"; fi
echo "built $out ($(wc -c < "$out/launcher.js") bytes of JS)"