Files
platforms/scripts/run_frontend.sh

24 lines
675 B
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env bash
set -Eeuo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)"
FRONTEND_DIR="${PROJECT_ROOT}/frontend/platform_admin"
if ! command -v pnpm >/dev/null 2>&1; then
echo "缺少命令pnpm" >&2
exit 1
fi
if [[ ! -d "${FRONTEND_DIR}/node_modules" ]]; then
echo "前端依赖尚未安装请先运行cd ${FRONTEND_DIR} && pnpm install" >&2
exit 1
fi
export VITE_API_BASE_URL="${VITE_API_BASE_URL:-http://localhost:12426/heqi/platform/v1}"
echo "启动平台前端http://localhost:5173"
cd "${FRONTEND_DIR}"
exec pnpm exec vite --config ./config/vite.config.ts --host 0.0.0.0