diff --git a/07-start-frontend.sh b/07-start-frontend.sh index e09ca0a..a0b088b 100755 --- a/07-start-frontend.sh +++ b/07-start-frontend.sh @@ -22,6 +22,7 @@ set -euo pipefail source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/common.sh" init_dirs +SCRIPT_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/$(basename "${BASH_SOURCE[0]}")" # 供文末打印访问地址(set -u 下须已定义;与 01-init-env 中 DEPLOY_TEST_IP 一致) if [[ -f "$ENV_FILE" ]]; then @@ -63,7 +64,7 @@ declare -A FE_CMD=( [h5]="npm run dev" [cms]="pnpm run dev -- --host 0.0.0.0 --port 8001" [build-cms]="pnpm run dev -- --host 0.0.0.0 --port 8002" - [build-down]="npm run dev -- --host 0.0.0.0 --port 8003" + [build-down]="npx umi dev --host 0.0.0.0 --port 8003" ) # cms/build-cms/build-down 不配置端口时默认都是 8000,需手动指定 @@ -73,7 +74,7 @@ declare -A FE_ENV=( [h5]="" [cms]="HOST=0.0.0.0 PORT=8001" [build-cms]="HOST=0.0.0.0 PORT=8002" - [build-down]="HOST=0.0.0.0 PORT=8003" + [build-down]="NODE_OPTIONS=--openssl-legacy-provider HOST=0.0.0.0 PORT=8003" ) declare -A FE_PORT=( @@ -260,7 +261,9 @@ if [[ "$TARGET" == "all" ]]; then step "启动全部前端开发服务器" FAILED=() for proj in "${FE_PROJECTS[@]}"; do - _start_fe "$proj" || FAILED+=("$proj") + if ! bash "$SCRIPT_PATH" "$proj"; then + FAILED+=("$proj") + fi done echo ""