You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
444 B
17 lines
444 B
/**
|
|
* 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 [];
|
|
}
|
|
|