feat(scala): Scala.js browser platform, snake and pong pages, build-web.sh
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
f4b671678e
commit
183821737e
5 files changed
+123
No files matched your search
Executable
+13
@@ -0,0 +1,13 @@
|
||||
#!/usr/bin/env bash
|
||||
# Usage: ./build-web.sh
|
||||
# Compiles src/ + web/ to JavaScript with Scala.js: web/dist/snake.js (index.html) and web/dist/pong.js (pong.html).
|
||||
# Then serve the repo root (node scripts/serve.mjs) and open http://localhost:8000/scala/index.html.
|
||||
set -euo pipefail
|
||||
cd "$(dirname "$0")"
|
||||
SCALA_CLI="${SCALA_CLI:-$(command -v scala-cli || echo "$HOME/.local/bin/scala-cli")}"
|
||||
mkdir -p web/dist
|
||||
build() { # <main class> <output file>
|
||||
"$SCALA_CLI" --power package --js --js-module-kind es src web project.scala --main-class "$1" -o "$2" -f
|
||||
}
|
||||
build snake.web.SnakeMain web/dist/snake.js
|
||||
build snake.web.PongMain web/dist/pong.js
|
||||
Reference in new issue
Block a user