grasscutterTools/config/vite/plugins/compress.ts
2022-05-02 18:38:10 +08:00

17 lines
393 B
TypeScript

/**
* @name ConfigCompressPlugin
* @description 开启.gz压缩
*/
import viteCompression from 'vite-plugin-compression';
import { COMPRESSION } from '../../constant';
export const ConfigCompressPlugin = () => {
if (COMPRESSION) {
return viteCompression({
ext: '.gz',
verbose: true,
deleteOriginFile: false,
})
}
return [];
}