Files
2026-06-18 15:13:24 +08:00

21 lines
630 B
Bash
Executable File
Raw Permalink 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
# 金值 Flutter web release 构建。产物输出到 build/web。
# 参数(环境变量覆盖):
# API_BASE_URL 接口地址(默认生产 API)
# BASE_HREF base href(默认 /flutter/
set -euo pipefail
API_BASE_URL="${API_BASE_URL:-https://jinzhi.api.yqzhice.top}"
BASE_HREF="${BASE_HREF:-/flutter/}"
echo "▶ flutter pub get"
flutter pub get
make runner
echo "▶ flutter build webbase-href=${BASE_HREF}api=${API_BASE_URL}"
flutter build web --release \
--base-href "$BASE_HREF" \
--dart-define=JINZHI_API_BASE_URL="$API_BASE_URL"
echo "✅ 构建完成 → build/web"