From 82e3e31277bf64e6233f7fb62ec7da99ef1ce0ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20B=C3=B6hmer?= Date: Sun, 18 Jan 2026 12:44:33 +0100 Subject: [PATCH] Only compress assets with a certain minimum size. Otherwise its quite inefficientg --- webpack.config.js | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/webpack.config.js b/webpack.config.js index 50bd3d39..08050353 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -169,22 +169,25 @@ for (const theme of AVAILABLE_THEMES) { if (Encore.isProduction()) { - Encore.addPlugin(new CompressionPlugin({ - filename: '[path][base].br', - algorithm: 'brotliCompress', - test: /\.(js|css|html|svg)$/, - compressionOptions: { - // zlib’s `level` option matches Brotli’s `BROTLI_PARAM_QUALITY` option. - level: 11, - }, - //threshold: 10240, - minRatio: 0.8, - deleteOriginalAssets: false, - })) + Encore + .addPlugin(new CompressionPlugin({ + filename: '[path][base].br', + algorithm: 'brotliCompress', + test: /\.(js|css|html|svg)$/, + compressionOptions: { + // zlib’s `level` option matches Brotli’s `BROTLI_PARAM_QUALITY` option. + level: 11, + }, + threshold: 10240, + minRatio: 0.8, + deleteOriginalAssets: false, + })) .addPlugin(new CompressionPlugin({ filename: '[path][base].gz', algorithm: 'gzip', + threshold: 10240, + minRatio: 0.8, test: /\.(js|css|html|svg)$/, deleteOriginalAssets: false, }))