Initial commit
This commit is contained in:
50
admin/build.bat
Normal file
50
admin/build.bat
Normal file
@@ -0,0 +1,50 @@
|
||||
@echo off
|
||||
chcp 65001 >nul
|
||||
setlocal enabledelayedexpansion
|
||||
|
||||
echo 🚀 开始构建电商管理后台...
|
||||
|
||||
:: 检查Node.js版本
|
||||
echo 📋 检查Node.js版本...
|
||||
node --version
|
||||
npm --version
|
||||
|
||||
:: 清理旧的构建文件
|
||||
echo 🧹 清理旧的构建文件...
|
||||
if exist dist rmdir /s /q dist
|
||||
|
||||
:: 安装依赖
|
||||
echo 📦 安装依赖...
|
||||
npm ci
|
||||
if !errorlevel! neq 0 (
|
||||
echo ❌ 依赖安装失败!
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
:: 运行代码检查
|
||||
echo 🔍 运行代码检查...
|
||||
npm run lint
|
||||
if !errorlevel! neq 0 (
|
||||
echo ⚠️ 代码检查有警告,继续构建...
|
||||
)
|
||||
|
||||
:: 构建生产版本
|
||||
echo 🏗️ 构建生产版本...
|
||||
npm run build:prod
|
||||
if !errorlevel! neq 0 (
|
||||
echo ❌ 构建失败!
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
:: 检查构建结果
|
||||
if exist dist (
|
||||
echo ✅ 构建成功!
|
||||
echo 📊 构建统计:
|
||||
dir dist /s
|
||||
) else (
|
||||
echo ❌ 构建失败!
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
echo 🎉 构建完成!
|
||||
pause
|
||||
Reference in New Issue
Block a user