chore: utils

This commit is contained in:
2025-08-04 14:47:12 +08:00
parent db57eb68cd
commit ed962166b1
3 changed files with 17 additions and 1 deletions

15
src/utils/post-build.ts Normal file
View File

@@ -0,0 +1,15 @@
import { tgz } from 'compressing';
import dayjs from 'dayjs';
import packageJson from '../../package.json';
const now = dayjs();
const fileName = `${packageJson.name}-${now.format('YYMMDD-HHmm')}`;
try {
await tgz.compressDir('./dist', `${fileName}.tar`);
await tgz.compressDir('./dist', `${fileName}.tar.gz`);
} catch (error) {
console.error('压缩失败:', error);
}