90978: Serve pre-compressed static files

This commit is contained in:
Yura Bondarenko
2022-04-28 09:22:28 +02:00
parent e65b5e2f1c
commit 7e391f0411
4 changed files with 88 additions and 11 deletions

View File

@@ -16,14 +16,14 @@ module.exports = Object.assign({}, commonExports, {
new CompressionPlugin({
filename: '[path][base].gz',
algorithm: 'gzip',
test: /\.(js|css|html|svg)$/,
test: /\.(js|css|html|svg|json5)$/,
threshold: 10240,
minRatio: 0.8,
}),
new CompressionPlugin({
filename: '[path][base].br',
algorithm: 'brotliCompress',
test: /\.(js|css|html|svg)$/,
test: /\.(js|css|html|svg|json5)$/,
compressionOptions: {
params: {
[zlib.constants.BROTLI_PARAM_QUALITY]: 11,