@@@@@@
This commit is contained in:
18
library/build/compress/index.ts
Normal file
18
library/build/compress/index.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import compressPlugin from 'vite-plugin-compression'
|
||||
|
||||
export const createCompress = (compress: any) => {
|
||||
if (compress === 'brotli') {
|
||||
return compressPlugin({
|
||||
ext: '.br',
|
||||
algorithm: 'brotliCompress',
|
||||
})
|
||||
}
|
||||
|
||||
if (compress === 'gzip' || compress) {
|
||||
return compressPlugin({
|
||||
ext: '.gz',
|
||||
})
|
||||
}
|
||||
|
||||
return []
|
||||
}
|
||||
Reference in New Issue
Block a user