From 7c5cd12d0e8fe7f599c455bae9207089e2cd3a72 Mon Sep 17 00:00:00 2001 From: unanmed <1319491857@qq.com> Date: Wed, 3 Sep 2025 17:29:17 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E6=89=93=E5=8C=85=E6=97=B6=E5=B0=86?= =?UTF-8?q?=20bg.jpg=20=E4=B9=9F=E6=89=93=E5=8C=85=E8=BF=9B=E5=8E=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/build-game.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/script/build-game.ts b/script/build-game.ts index cca350c..bef646f 100644 --- a/script/build-game.ts +++ b/script/build-game.ts @@ -1,7 +1,7 @@ import { build, loadConfigFromFile, mergeConfig, UserConfig } from 'vite'; import legacy from '@vitejs/plugin-legacy'; import { resolve } from 'path'; -import { copy, emptyDir, ensureDir } from 'fs-extra'; +import { copy, emptyDir, ensureDir, pathExists } from 'fs-extra'; import { OutputAsset, OutputChunk, RollupOutput } from 'rollup'; import Fontmin from 'fontmin'; import { readdir, readFile, rmdir, stat, writeFile } from 'fs/promises'; @@ -597,6 +597,15 @@ async function buildGame() { resolve(process.cwd(), 'script/template/启动服务.exe'), resolve(distDir, '启动服务.exe') ); + + const bgPath = 'project/images/bg.jpg'; + + if (await pathExists(resolve(tempDir, 'client', bgPath))) { + await copy( + resolve(tempDir, 'client', bgPath), + resolve(distDir, bgPath) + ); + } } catch (e) { logProgress(6, ProgressStatus.Fail); process.stderr.write(String(e));