From a89bf40e50f3d51ee03fb989f42edc2736a1171a Mon Sep 17 00:00:00 2001 From: unanmed <1319491857@qq.com> Date: Thu, 25 Sep 2025 11:29:03 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E6=B7=BB=E5=8A=A0=E5=8E=8B=E7=BC=A9?= =?UTF-8?q?=E5=8C=85=E8=BF=87=E5=A4=A7=E6=97=B6=E7=9A=84=E5=8F=AF=E8=83=BD?= =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=96=B9=E6=A1=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/build-game.ts | 15 ++++++++++++++- vite.config.ts | 2 -- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/script/build-game.ts b/script/build-game.ts index 9ba67ff..2fc0c92 100644 --- a/script/build-game.ts +++ b/script/build-game.ts @@ -399,7 +399,7 @@ async function buildGame() { if (level === ClientDataLevel.Error) { logProgress(2, ProgressStatus.Fail); process.stderr.write( - `客户端似乎引用了数据端内容,请仔细检查后再构建!` + `数据端似乎引用了客户端内容,请仔细检查后再构建!` ); process.exit(1); } @@ -647,6 +647,19 @@ async function buildGame() { process.stdout.write( `⚠️ 压缩包大于 100M,可能导致发塔困难,请考虑降低塔的大小\r\n` ); + const suggections: string[] = []; + if (dataObject.main.bgms.some(v => !v.endsWith('opuw'))) { + suggections.push(`将 BGM 和音效换用 opus 格式`); + } + if (dataObject.main.images.some(v => !v.endsWith('webp'))) { + suggections.push(`将图片换用无损 webp 格式`); + } + if (suggections.length > 0) { + process.stdout.write(`降低压缩包体积的可能方案:\r\n`); + suggections.forEach((v, i) => { + process.stdout.write(`${i + 1}. ${v}\r\n`); + }); + } } process.stdout.write(`压缩包大小:${formatSize(zipSize)}\r\n`); process.stdout.write(`源码大小:${formatSize(sourceSize)}\r\n`); diff --git a/vite.config.ts b/vite.config.ts index 3c2fcb6..d79c981 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -5,8 +5,6 @@ import path from 'path'; import postcssPresetEnv from 'postcss-preset-env'; import * as glob from 'glob'; -const FSHOST = 'http://127.0.0.1:3000/'; - const custom = [ 'container', 'image', 'sprite', 'shader', 'text', 'comment', 'custom', 'layer', 'layer-group', 'animate', 'damage', 'graphics', 'icon', 'winskin',