gf-vben-admin/build/vite/plugin/gzip.ts
2021-01-11 00:16:44 +08:00

13 lines
298 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 [];
}