mirror of
https://github.com/unanmed/HumanBreak.git
synced 2025-09-06 08:11:46 +08:00
chore: 打包时将 bg.jpg 也打包进去
This commit is contained in:
parent
0d98a6ce57
commit
7c5cd12d0e
@ -1,7 +1,7 @@
|
|||||||
import { build, loadConfigFromFile, mergeConfig, UserConfig } from 'vite';
|
import { build, loadConfigFromFile, mergeConfig, UserConfig } from 'vite';
|
||||||
import legacy from '@vitejs/plugin-legacy';
|
import legacy from '@vitejs/plugin-legacy';
|
||||||
import { resolve } from 'path';
|
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 { OutputAsset, OutputChunk, RollupOutput } from 'rollup';
|
||||||
import Fontmin from 'fontmin';
|
import Fontmin from 'fontmin';
|
||||||
import { readdir, readFile, rmdir, stat, writeFile } from 'fs/promises';
|
import { readdir, readFile, rmdir, stat, writeFile } from 'fs/promises';
|
||||||
@ -597,6 +597,15 @@ async function buildGame() {
|
|||||||
resolve(process.cwd(), 'script/template/启动服务.exe'),
|
resolve(process.cwd(), 'script/template/启动服务.exe'),
|
||||||
resolve(distDir, '启动服务.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) {
|
} catch (e) {
|
||||||
logProgress(6, ProgressStatus.Fail);
|
logProgress(6, ProgressStatus.Fail);
|
||||||
process.stderr.write(String(e));
|
process.stderr.write(String(e));
|
||||||
|
Loading…
Reference in New Issue
Block a user