Files
launcher/scripts/build-web.sh
T
SpriteandClaude Sonnet 5.5 637129aa4e Add the web runtime (DOM patcher, events, host bridge) and a browser e2e
web/ is the js-target MoonBit program: it renders app.view into the DOM with a
keyed patcher, turns pointer/touch/key events into app input, runs effects
against window.Android or demo stand-ins, and exposes window.launcher.* for the
Android shell. tests/e2e.cjs ports the legacy Playwright flows and passes
against the build; scripts/build-web.sh assembles dist/web.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-23 01:02:08 +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)"