auto-sync: 2026-05-22 18:25:08

This commit is contained in:
cfdaily
2026-05-22 18:25:08 +08:00
parent e3e076bb93
commit f575a36971
+25
View File
@@ -0,0 +1,25 @@
#!/usr/bin/env bash
# build-frontend.sh — 构建 moziplus v2 前端
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
PROJECT_DIR="$(dirname "$SCRIPT_DIR")"
FRONTEND_DIR="$PROJECT_DIR/src/frontend"
echo "🔨 Building moziplus v2 frontend..."
cd "$FRONTEND_DIR"
# 安装依赖(首次或 lock 文件变化时)
if [ ! -d "node_modules" ] || [ "package-lock.json" -nt "node_modules" ]; then
echo "📦 Installing dependencies..."
npm install --frozen-lockfile 2>/dev/null || npm install
fi
# 构建
echo "🏗️ Building..."
npm run build
echo ""
echo "✅ Frontend built successfully"
echo " Output: $FRONTEND_DIR/dist/"