This repository was archived by the owner on Aug 24, 2023. It is now read-only.
File tree 1 file changed +8
-4
lines changed 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -401,8 +401,9 @@ module.exports = {
401
401
algorithm: ' brotliCompress' ,
402
402
test: / \. (js| css| html| svg)$ / ,
403
403
compressionOptions: {
404
- // zlib’s `level` option matches Brotli’s `BROTLI_PARAM_QUALITY` option.
405
- level: 11 ,
404
+ params: {
405
+ [zlib .constants .BROTLI_PARAM_QUALITY ]: 11 ,
406
+ },
406
407
},
407
408
threshold: 10240 ,
408
409
minRatio: 0.8 ,
@@ -412,7 +413,8 @@ module.exports = {
412
413
};
413
414
```
414
415
415
- ** Note** The ` level ` option matches ` BROTLI_PARAM_QUALITY ` [ for Brotli-based streams] ( https://nodejs.org/api/zlib.html#zlib_for_brotli_based_streams )
416
+ ** Note** Brotli’s ` BROTLI_PARAM_QUALITY ` option is functionally equivalent to zlib’s ` level ` option.
417
+ You can find all Brotli’s options in [ the relevant part of the zlib module documentation] ( https://nodejs.org/api/zlib.html#zlib_class_brotlioptions ) .
416
418
417
419
### Multiple compressed versions of assets for different algorithm
418
420
@@ -435,7 +437,9 @@ module.exports = {
435
437
algorithm: ' brotliCompress' ,
436
438
test: / \. (js| css| html| svg)$ / ,
437
439
compressionOptions: {
438
- level: 11 ,
440
+ params: {
441
+ [zlib .constants .BROTLI_PARAM_QUALITY ]: 11 ,
442
+ },
439
443
},
440
444
threshold: 10240 ,
441
445
minRatio: 0.8 ,
You can’t perform that action at this time.
0 commit comments