mirror of
https://github.com/vbenjs/vue-vben-admin.git
synced 2025-08-27 19:29:04 +08:00
18 lines
444 B
TypeScript
18 lines
444 B
TypeScript
/**
|
|
* Used to package and output gzip. Note that this does not work properly in Vite, the specific reason is still being investigated
|
|
*/
|
|
import type { Plugin } from 'vite';
|
|
|
|
import gzipPlugin from 'rollup-plugin-gzip';
|
|
import { isBuildGzip } from '../../utils';
|
|
|
|
export function configGzipPlugin(isBuild: boolean): Plugin | Plugin[] {
|
|
const useGzip = isBuild && isBuildGzip();
|
|
|
|
if (useGzip) {
|
|
return gzipPlugin();
|
|
}
|
|
|
|
return [];
|
|
}
|