
* fix 修复变量问题 * Merge remote-tracking branch 'origin/dev' into dev * update 依赖升级 * update 依赖升级 * Merge remote-tracking branch 'origin/dev' into dev * 升级依赖 * Merge remote-tracking branch 'origin/ts' into ts * 升级依赖 * Merge branch 'dev' of gitee.com:JavaLionLi/plus-ui into ts * 升级依赖 * !61 fix: 删除重复环境变量ElUploadInstance * fix: 删除重复环境变量ElUploadInstance
29 lines
716 B
TypeScript
29 lines
716 B
TypeScript
import compression from 'vite-plugin-compression';
|
|
|
|
export default (env: any) => {
|
|
const { VITE_BUILD_COMPRESS } = env;
|
|
const plugin: any[] = [];
|
|
if (VITE_BUILD_COMPRESS) {
|
|
const compressList = VITE_BUILD_COMPRESS.split(',');
|
|
if (compressList.includes('gzip')) {
|
|
// http://doc.ruoyi.vip/ruoyi-vue/other/faq.html#使用gzip解压缩静态文件
|
|
plugin.push(
|
|
compression({
|
|
ext: '.gz',
|
|
deleteOriginFile: false
|
|
})
|
|
);
|
|
}
|
|
if (compressList.includes('brotli')) {
|
|
plugin.push(
|
|
compression({
|
|
ext: '.br',
|
|
algorithm: 'brotliCompress',
|
|
deleteOriginFile: false
|
|
})
|
|
);
|
|
}
|
|
}
|
|
return plugin;
|
|
};
|