Files
sgxt_web/打包.bat
2025-12-17 11:07:52 +08:00

56 lines
1.3 KiB
Batchfile

@echo off
chcp 65001 >nul
title 构建和打包工具
echo ========================================
echo 林芝哨岗 vue构建和打包工具
echo ========================================
echo.
cd /d "%~dp0"
echo [1/3] 清理旧的构建文件...
@REM if exist gsxt (
@REM rmdir /s /q gsxt
@REM )
if exist gsxt.zip (
del gsxt.zip
)
echo.
echo [2/3] 开始构建项目...
call npm run build
if %ERRORLEVEL% NEQ 0 (
echo.
echo ❌ 构建失败!请检查错误信息。
pause
exit /b 1
)
echo.
echo [3/3] 压缩构建文件...
if not exist gsxt (
echo ❌ 找不到构建输出文件夹 gsxt
pause
exit /b 1
)
powershell Compress-Archive -Path gsxt -DestinationPath gsxt.zip
if %ERRORLEVEL% EQU 0 (
echo.
echo ✅ 构建和打包完成!
echo 📦 输出文件: gsxt.zip
echo 📁 文件大小:
dir gsxt.zip | findstr gsxt.zip
start http://localhost:9528?project=sgxt_pc
explorer .
msg * "林芝哨岗打包完成!"
@REM powershell -Command "Add-Type -AssemblyName System.Windows.Forms; [System.Windows.Forms.MessageBox]::Show('打包和压缩已完成!', '成功', [System.Windows.Forms.MessageBoxButtons]::OK, [System.Windows.Forms.MessageBoxIcon]::Exclamation)"
) else (
echo ❌ 压缩失败!
)
echo.
echo 按任意键退出...
pause >nul