mosdns/build-vue.bat
dengxiongjian ee06785e08
Some checks are pending
Test mosdns / build (push) Waiting to run
开发web管理
2025-10-15 22:20:27 +08:00

72 lines
1.3 KiB
Batchfile
Raw 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.

@echo off
chcp 65001 >nul
echo.
echo ====================================
echo MosDNS Vue 版本构建脚本
echo ====================================
echo.
echo [1/3] 检查 Node.js 环境...
where node >nul 2>nul
if errorlevel 1 (
echo ❌ 错误: 未找到 Node.js
echo 请先安装 Node.js: https://nodejs.org/
pause
exit /b 1
)
echo ✅ Node.js 已安装
echo.
echo [2/3] 构建 Vue 前端...
cd web-ui
if not exist "node_modules\" (
echo 📦 首次构建,正在安装依赖...
call npm install
if errorlevel 1 (
echo ❌ npm install 失败!
cd ..
pause
exit /b 1
)
)
echo 🔨 正在构建 Vue 项目...
call npm run build
if errorlevel 1 (
echo ❌ Vue 构建失败!
cd ..
pause
exit /b 1
)
echo ✅ Vue 构建完成
cd ..
echo.
echo [3/3] 构建 Go 后端...
echo 🔨 正在编译 Go 程序...
go build -o dist\mosdns-vue.exe .
if errorlevel 1 (
echo ❌ Go 编译失败!
pause
exit /b 1
)
echo ✅ Go 编译完成
echo.
echo ====================================
echo ✅ 构建完成!
echo ====================================
echo.
echo 可执行文件: dist\mosdns-vue.exe
echo.
echo 运行命令:
echo dist\mosdns-vue.exe start -c config.yaml
echo.
echo 然后访问: http://localhost:5555
echo.
pause