gf-vben-admin/build/vite/plugin/gzip.ts

13 lines
298 B
TypeScript
Raw Normal View History

2021-01-09 23:28:52 +08:00
import gzipPlugin from 'rollup-plugin-gzip';
import { isBuildGzip } from '../../utils';
import { Plugin } from 'vite';
export function configGzipPlugin(isBuild: boolean): Plugin | Plugin[] {
2021-01-11 00:16:44 +08:00
const useGzip = isBuild && isBuildGzip();
2021-01-09 23:28:52 +08:00
if (useGzip) {
return gzipPlugin();
}
return [];
}