chore: utils
This commit is contained in:
15
src/utils/post-build.ts
Normal file
15
src/utils/post-build.ts
Normal 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);
|
||||
}
|
||||
Reference in New Issue
Block a user