Files
admin_core/build.bat
张成 2e1cd65b07 init
2025-10-08 15:10:33 +08:00

77 lines
1.7 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
setlocal enabledelayedexpansion
echo ================================
echo Admin Framework 构建工具
echo ================================
echo.
REM 检查 Node.js 是否安装
where node >nul 2>nul
if %errorlevel% neq 0 (
echo ❌ 错误: 未检测到 Node.js请先安装 Node.js
pause
exit /b 1
)
for /f "tokens=*" %%i in ('node -v') do set NODE_VERSION=%%i
for /f "tokens=*" %%i in ('npm -v') do set NPM_VERSION=%%i
echo ✅ Node.js 版本: %NODE_VERSION%
echo ✅ NPM 版本: %NPM_VERSION%
echo.
REM 检查是否已安装依赖
if not exist "node_modules" (
echo 📦 正在安装依赖...
call npm install
if !errorlevel! neq 0 (
echo ❌ 依赖安装失败
pause
exit /b 1
)
echo ✅ 依赖安装成功
echo.
) else (
echo ✅ 依赖已安装
echo.
)
REM 执行打包
echo 🔨 正在打包框架...
call npm run build
if %errorlevel% equ 0 (
echo.
echo ================================
echo ✅ 打包成功!
echo ================================
echo.
echo 📦 输出文件: dist\admin-framework.js
REM 显示文件大小
if exist "dist\admin-framework.js" (
for %%A in (dist\admin-framework.js) do (
set SIZE=%%~zA
set /a SIZE_KB=!SIZE! / 1024
echo 📊 文件大小: !SIZE_KB! KB
)
)
echo.
echo 📚 下一步:
echo 1. 将 dist\admin-framework.js 复制到你的项目
echo 2. 查看 QUICK_START.md 了解如何使用
echo 3. 查看 USAGE_EXAMPLE.md 了解详细示例
echo.
) else (
echo.
echo ❌ 打包失败,请检查错误信息
pause
exit /b 1
)
pause