Files
assist/build_frontend.bat

55 lines
976 B
Batchfile
Raw Normal View History

@echo off
echo 构建TSP智能助手前端...
echo.
cd frontend
echo 检查Node.js环境...
node --version >nul 2>&1
if %errorlevel% neq 0 (
echo 错误: 未找到Node.js请先安装Node.js
echo 下载地址: https://nodejs.org/
pause
exit /b 1
)
echo 检查npm环境...
npm --version >nul 2>&1
if %errorlevel% neq 0 (
echo 错误: 未找到npm请检查Node.js安装
pause
exit /b 1
)
echo 检查依赖包...
if not exist "node_modules" (
echo 安装依赖包...
npm install
if %errorlevel% neq 0 (
echo 错误: 依赖包安装失败
pause
exit /b 1
)
)
echo 运行类型检查...
npm run type-check
if %errorlevel% neq 0 (
echo 警告: 类型检查失败,但继续构建...
)
echo 构建生产版本...
npm run build
if %errorlevel% neq 0 (
echo 错误: 构建失败
pause
exit /b 1
)
echo.
echo 构建完成!
echo 构建文件已输出到: src/web/static/dist
echo.
pause