gf-vben-admin/build/vite/plugin/gzip.ts
2021-01-09 23:28:52 +08:00

13 lines
296 B
TypeScript

import gzipPlugin from 'rollup-plugin-gzip';
import { isBuildGzip } from '../../utils';
import { Plugin } from 'vite';
export function configGzipPlugin(isBuild: boolean): Plugin | Plugin[] {
const useGzip = isBuild && isBuildGzip;
if (useGzip) {
return gzipPlugin();
}
return [];
}