#!/usr/bin/env bash
# 在项目根目录执行：./deploy/build.sh
set -e
ROOT="$(cd "$(dirname "$0")/.." && pwd)"

echo ">>> 构建前端..."
cd "$ROOT/frontend"
npm ci
npm run build

echo ">>> 完成。静态文件在 frontend/dist/"
echo "    生产部署请将 dist 同步到服务器，例如："
echo "    rsync -avz frontend/dist/ user@server:/var/www/wordloop/frontend/dist/"
