bladex前端ui项目,基于avue-cli2.0开发
包含基础工作流,不包含表单设计器
https://git.javablade.com/blade/Saber
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
660 B
28 lines
660 B
|
3 years ago
|
import compression from 'vite-plugin-compression'
|
||
|
|
|
||
|
|
export default function createCompression (env) {
|
||
|
|
const { VITE_BUILD_COMPRESS } = env
|
||
|
|
const plugin = []
|
||
|
|
if (VITE_BUILD_COMPRESS) {
|
||
|
|
const compressList = VITE_BUILD_COMPRESS.split(',')
|
||
|
|
if (compressList.includes('gzip')) {
|
||
|
|
plugin.push(
|
||
|
|
compression({
|
||
|
|
ext: '.gz',
|
||
|
|
deleteOriginFile: false
|
||
|
|
})
|
||
|
|
)
|
||
|
|
}
|
||
|
|
if (compressList.includes('brotli')) {
|
||
|
|
plugin.push(
|
||
|
|
compression({
|
||
|
|
ext: '.br',
|
||
|
|
algorithm: 'brotliCompress',
|
||
|
|
deleteOriginFile: false
|
||
|
|
})
|
||
|
|
)
|
||
|
|
}
|
||
|
|
}
|
||
|
|
return plugin
|
||
|
|
}
|