1
0
Files
kobopatch-webui/serve-locally.sh
Nico Verbruggen 290b8a32b7
All checks were successful
Build and test project / build-and-test (push) Successful in 1m29s
Don't use nginx locally
2026-03-19 20:16:00 +01:00

30 lines
691 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
WEB_DIR="$SCRIPT_DIR/web"
SRC_DIR="$WEB_DIR/src"
DIST_DIR="$WEB_DIR/dist"
WASM_DIR="$SCRIPT_DIR/kobopatch-wasm"
if [ ! -f "$SRC_DIR/nickelmenu/NickelMenu.zip" ]; then
echo "NickelMenu assets not found, downloading..."
"$SCRIPT_DIR/nickelmenu/setup.sh"
fi
echo "Building JS bundle..."
cd "$WEB_DIR"
npm install --silent
npm run build
if [ ! -f "$DIST_DIR/wasm/kobopatch.wasm" ]; then
echo "WASM binary not found, building..."
if [ ! -d "$WASM_DIR/kobopatch-src" ]; then
"$WASM_DIR/setup.sh"
fi
"$WASM_DIR/build.sh"
fi
echo "Serving at http://localhost:8888"
node serve.mjs