修复打包

This commit is contained in:
小朱
2025-07-09 19:32:23 +08:00
parent 0a5bd355a6
commit f2c6de3920
6 changed files with 25 additions and 10 deletions

View File

@@ -51,6 +51,19 @@ async function createPackage() {
await fs.ensureDir(path.join(packageDir, 'server', 'uploads'))
console.log('📁 创建uploads目录...')
// 复制server/data/games目录包含游戏配置文件
const serverGamesPath = path.join(__dirname, '..', 'server', 'data', 'games')
if (await fs.pathExists(serverGamesPath)) {
await fs.ensureDir(path.join(packageDir, 'server', 'data'))
await fs.copy(
serverGamesPath,
path.join(packageDir, 'server', 'data', 'games')
)
console.log('📋 复制游戏配置文件...')
} else {
console.log('⚠️ 警告: server/data/games 目录不存在,跳过复制')
}
console.log('📥 安装服务端生产依赖...')
// 在打包的服务端目录中安装生产依赖
try {