mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-01-19 00:29:35 +00:00
Only compress assets with a certain minimum size. Otherwise its quite inefficientg
This commit is contained in:
parent
0d4f935b43
commit
82e3e31277
1 changed files with 15 additions and 12 deletions
|
|
@ -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)$/,
|
||||||
// zlib’s `level` option matches Brotli’s `BROTLI_PARAM_QUALITY` option.
|
compressionOptions: {
|
||||||
level: 11,
|
// zlib’s `level` option matches Brotli’s `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,
|
||||||
}))
|
}))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue