fix:优化启动配置
This commit is contained in:
14
start-front.sh
Normal file
14
start-front.sh
Normal file
@@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env bash
|
||||
# 构建前端并启动静态服务预览(前后端分离时前端预览)
|
||||
# 在项目根目录执行: ./start-front.sh 或 FRONT_PORT=8080 ./start-front.sh
|
||||
# 需在 api.config.json 中配置 apiBase 指向后端地址
|
||||
|
||||
set -e
|
||||
cd "$(dirname "$0")"
|
||||
FRONT_PORT="${FRONT_PORT:-8990}"
|
||||
|
||||
echo "[720yun-offline] 构建前端到 dist/..."
|
||||
npm run build
|
||||
|
||||
echo "[720yun-offline] 启动静态预览 http://0.0.0.0:${FRONT_PORT}(仅前端,API 需单独启动并配置 api.config.json)"
|
||||
exec npx --yes serve dist -l "${FRONT_PORT}"
|
||||
Reference in New Issue
Block a user