康来智慧冷链系统 - 前端
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.
 
 
 
 
 

28 lines
862 B

/**
* @program: kicc-ui
* @description: rollup-plugin-visualizer配置
* 提供分析依赖查看哪些模块占用了空间
* 文档: https://github.com/btd/rollup-plugin-visualizer
* @author: wangxiang4
* @create: 2022/4/5
*/
import visualizer from 'rollup-plugin-visualizer';
import { isReportMode } from '../../utils';
import type { PluginOption } from 'vite';
export function configVisualizerConfig() {
if (isReportMode()) {
return visualizer({
// 生成图表的文件的名称
filename: './node_modules/.cache/visualizer/stats.html',
// 生成完毕自动打开生成的文件
open: true,
// 从源代码中收集gzip大小并将其显示在图表中
gzipSize: true,
// 从源代码中收集brotli大小并将其显示在图表中
brotliSize: true,
}) as PluginOption;
}
return [];
}