Only compress assets with a certain minimum size. Otherwise its quite inefficientg

This commit is contained in:
Jan Böhmer 2026-01-18 12:44:33 +01:00
parent 0d4f935b43
commit 82e3e31277

View file

@ -169,22 +169,25 @@ for (const theme of AVAILABLE_THEMES) {
if (Encore.isProduction()) { if (Encore.isProduction()) {
Encore.addPlugin(new CompressionPlugin({ Encore
filename: '[path][base].br', .addPlugin(new CompressionPlugin({
algorithm: 'brotliCompress', filename: '[path][base].br',
test: /\.(js|css|html|svg)$/, algorithm: 'brotliCompress',
compressionOptions: { test: /\.(js|css|html|svg)$/,
// zlibs `level` option matches Brotlis `BROTLI_PARAM_QUALITY` option. compressionOptions: {
level: 11, // zlibs `level` option matches Brotlis `BROTLI_PARAM_QUALITY` option.
}, level: 11,
//threshold: 10240, },
minRatio: 0.8, threshold: 10240,
deleteOriginalAssets: false, minRatio: 0.8,
})) deleteOriginalAssets: false,
}))
.addPlugin(new CompressionPlugin({ .addPlugin(new CompressionPlugin({
filename: '[path][base].gz', filename: '[path][base].gz',
algorithm: 'gzip', algorithm: 'gzip',
threshold: 10240,
minRatio: 0.8,
test: /\.(js|css|html|svg)$/, test: /\.(js|css|html|svg)$/,
deleteOriginalAssets: false, deleteOriginalAssets: false,
})) }))