From 772286b162ad9c40754c26e43ac45bef0140e28c Mon Sep 17 00:00:00 2001 From: unanmed <1319491857@qq.com> Date: Fri, 28 Apr 2023 17:09:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=AD=97=E4=BD=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/build.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/script/build.ts b/script/build.ts index 6f1e8a8..b4b4459 100644 --- a/script/build.ts +++ b/script/build.ts @@ -55,15 +55,18 @@ import * as rollup from 'rollup'; const project = await fs.readdir('./public/project'); const floors = await fs.readdir('./public/project/floors'); const assets = await fs.readdir('./dist/assets/'); + const plugin = await fs.readdir('./public/project/plugin'); const all = [ ...libs.map(v => `./public/libs/${v}`), ...project.map(v => `./public/project/${v}`), ...floors.map(v => `./public/project/floors/${v}`), - ...assets.map(v => `./dist/assets/${v}`) + ...assets.map(v => `./dist/assets/${v}`), + ...plugin.map(v => `./public/project/plugin/${v}`) ]; for await (const dir of all) { const stat = await fs.stat(dir); if (!stat.isFile()) continue; + if (dir.endsWith('.ttf')) continue; const file = await fs.readFile(dir, 'utf-8'); for (let i = 0; i < file.length; i++) { const char = file[i]; @@ -132,4 +135,9 @@ import * as rollup from 'rollup'; } catch { console.log('main.js压缩失败'); } + + // 5. 杂项 + try { + await fse.copy('./LICENSE', './dist/LICENSE'); + } catch {} })();