Files
ttstd-3d-director/build-electron.bat
tongtongstudio b9fd289caf chore: 迁移到 pnpm 并更新打包与测试文档
- 用 pnpm 替换 npm,锁定 pnpm@10.33.0,删除 package-lock.json 相关说明
- package.json 将渲染层依赖移入 devDependencies,减小 app.asar 体积
- 新增 electron:smoke 冒烟脚本与 icon 生成脚本
- win 平台设置 AppUserModelID,修复任务栏图标归组
- 清理 tsBuildInfoFile 输出路径至 node_modules/.tmp
- 更新测试断言以匹配画幅遮罩、取景器缩放与模型库外部资产行为
- README 与打包指南补充 pnpm、镜像与常见问题说明
2026-09-16 20:03:57 +08:00

59 lines
1.4 KiB
Batchfile
Raw Permalink 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
setlocal
cd /d "%~dp0"
rem Electron / electron-builder 二进制下载走国内镜像
set ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/
set ELECTRON_BUILDER_BINARIES_MIRROR=https://npmmirror.com/mirrors/electron-builder-binaries/
echo ========================================
echo StoryAI 3D Director Desk - Package Tool
echo ========================================
echo.
echo [0/4] Cleaning old output...
if exist "release" (
rmdir /s /q "release" 2>nul
if exist "release" (
echo Cannot delete release folder, please close any running exe first
pause
exit /b 1
)
)
rem 不要再单独删除 node_modules 里的某个包(例如 node_modules\electron)。
rem 绕过包管理器删包,会让 pnpm 仍以为该依赖已安装,反而产出缺失/空壳的依赖目录。
rem 需要重装时统一执行 pnpm install。
echo [1/4] Installing dependencies with pnpm...
call pnpm install
if errorlevel 1 (
echo Install failed! Install pnpm first: npm i -g pnpm
pause
exit /b 1
)
echo.
echo [2/4] Building frontend...
call pnpm run build
if errorlevel 1 (
echo Build failed!
pause
exit /b 1
)
echo.
echo [3/4] Packaging to exe...
call pnpm exec electron-builder --win
if errorlevel 1 (
echo Package failed!
pause
exit /b 1
)
echo.
echo ========================================
echo Done! Check release folder for exe
echo ========================================
pause