#!/usr/bin/env bash set -euo pipefail ROOT="$(cd "$(dirname "$0")/../.." && pwd)" FRONTEND="$ROOT/frontend" OUT="$ROOT/ios/WordLoop/WordLoop/www" echo ">>> 构建 iOS 内嵌前端" cd "$FRONTEND" if [ ! -d node_modules ]; then npm install --silent fi npm run build:ios rm -rf "$OUT" mkdir -p "$OUT" cp -R dist/* "$OUT/" python3 - <', f"") html = html.replace( '', "", ) # 脚本放在 前,确保 #app 已存在(head 内联会导致 Vue mount 失败、白屏) html = html.replace( "", f" \\n ", ) html_path.write_text(html, encoding="utf-8") print(">>> 已内联 app.js / app.css 到 index.html") PY echo ">>> 已复制到 $OUT"