Blame view

build/vite/plugin/gzip.ts 298 Bytes
vben authored
1
2
3
4
import gzipPlugin from 'rollup-plugin-gzip';
import { isBuildGzip } from '../../utils';
import { Plugin } from 'vite';
export function configGzipPlugin(isBuild: boolean): Plugin | Plugin[] {
vben authored
5
  const useGzip = isBuild && isBuildGzip();
vben authored
6
7
8
9
10
11
12

  if (useGzip) {
    return gzipPlugin();
  }

  return [];
}