This commit is contained in:
sagiferi
2026-10-24 13:20:55 +02:00
parent 93e06d148a
commit b33d1543fc
326 changed files with 20843 additions and 3 deletions
+27
View File
@@ -0,0 +1,27 @@
#!/usr/bin/env bash
# Build the Rust WASM engine + React frontend, then bundle the production build
# into assets/web/ so the Flutter InAppLocalhostServer can serve it inside the app.
#
# Run from anywhere: ./scripts/build_web.sh
set -euo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
cd "$ROOT"
echo "==> Building Rust WASM (wasm-pack, target web)"
( cd wasm && wasm-pack build --target web )
echo "==> Building React frontend (vite)"
( cd wasm/frontend && npm run build )
echo "==> Bundling dist/ -> assets/web/"
rm -rf assets/web
mkdir -p assets/web
cp -R wasm/frontend/dist/. assets/web/
echo "==> Done. assets/web/ contents:"
ls -la assets/web
echo
echo "Flutter will serve this at http://localhost:8080 via InAppLocalhostServer."
echo "Remember to run 'flutter pub get' if pubspec assets changed."