mirror of
https://github.com/xsf0105/vue3-h5-template.git
synced 2025-04-05 12:40:05 +08:00
19 lines
484 B
TypeScript
19 lines
484 B
TypeScript
/**
|
|
* @name ConfigCompressPlugin
|
|
* @description 开启.gz压缩
|
|
*/
|
|
import viteCompression from 'vite-plugin-compression';
|
|
|
|
export const ConfigCompressPlugin = () => {
|
|
return viteCompression({
|
|
verbose: true, // 默认即可
|
|
disable: false, //开启压缩(不禁用),默认即可
|
|
deleteOriginFile: false, //删除源文件
|
|
threshold: 10240, //压缩前最小文件大小
|
|
algorithm: 'gzip', //压缩算法
|
|
ext: '.gz', //文件类型
|
|
});
|
|
|
|
return [];
|
|
};
|