优化构建

This commit is contained in:
hooray 2022-10-12 01:37:55 +08:00
parent 371ba26f51
commit 77353ec8c6

View File

@ -7,19 +7,17 @@ export default function createCompression(env) {
if (compressList.includes('gzip')) {
plugin.push(
compression({
filter: /\.(js|mjs|json|css)$/i,
ext: '.gz',
deleteOriginFile: true,
deleteOriginFile: false,
}),
)
}
if (compressList.includes('brotli')) {
plugin.push(
compression({
filter: /\.(js|mjs|json|css)$/i,
ext: '.br',
algorithm: 'brotliCompress',
deleteOriginFile: true,
deleteOriginFile: false,
}),
)
}