File tree Expand file tree Collapse file tree 3 files changed +25
-0
lines changed
Expand file tree Collapse file tree 3 files changed +25
-0
lines changed Original file line number Diff line number Diff line change 148148 "babel-plugin-react-remove-properties" : " ^0.3.0" ,
149149 "babel-plugin-transform-import-meta" : " ^2.2.1" ,
150150 "babel-plugin-transform-react-remove-prop-types" : " ^0.4.24" ,
151+ "compression-webpack-plugin" : " ^11.1.0" ,
151152 "css-loader" : " ^6.11.0" ,
152153 "cssnano" : " ^6.1.2" ,
153154 "dotenv-webpack" : " ^8.0.1" ,
Original file line number Diff line number Diff line change @@ -2,6 +2,8 @@ const { merge } = require('webpack-merge');
22const TerserPlugin = require ( 'terser-webpack-plugin' ) ;
33const MomentTimezoneDataPlugin = require ( 'moment-timezone-data-webpack-plugin' ) ;
44const ImageMinimizerPlugin = require ( 'image-minimizer-webpack-plugin' ) ;
5+ const CompressionPlugin = require ( 'compression-webpack-plugin' ) ;
6+ const zlib = require ( 'zlib' ) ;
57
68const common = require ( './webpack.common' ) ;
79
@@ -67,5 +69,19 @@ module.exports = merge(common, {
6769 implementation : ImageMinimizerPlugin . svgoMinify ,
6870 } ,
6971 } ) ,
72+ new CompressionPlugin ( {
73+ test : / \. ( j s | c s s | h t m l | s v g | p n g ) $ / ,
74+ algorithm : 'gzip' ,
75+ } ) ,
76+ new CompressionPlugin ( {
77+ algorithm : 'brotliCompress' ,
78+ test : / \. ( j s | c s s | h t m l | s v g | p n g ) $ / ,
79+ compressionOptions : {
80+ params : {
81+ [ zlib . constants . BROTLI_PARAM_QUALITY ] : 11 ,
82+ } ,
83+ } ,
84+ threshold : 10240 ,
85+ } ) ,
7086 ] ,
7187} ) ;
Original file line number Diff line number Diff line change @@ -4262,6 +4262,14 @@ compressible@~2.0.16:
42624262 dependencies:
42634263 mime-db ">= 1.43.0 < 2"
42644264
4265+ compression-webpack-plugin@^11.1.0:
4266+ version "11.1.0"
4267+ resolved "https://registry.yarnpkg.com/compression-webpack-plugin/-/compression-webpack-plugin-11.1.0.tgz#ee340d2029cf99ccecdea9ad1410b377d15b48b3"
4268+ integrity sha512-zDOQYp10+upzLxW+VRSjEpRRwBXJdsb5lBMlRxx1g8hckIFBpe3DTI0en2w7h+beuq89576RVzfiXrkdPGrHhA==
4269+ dependencies:
4270+ schema-utils "^4.2.0"
4271+ serialize-javascript "^6.0.2"
4272+
42654273compression@^1.7.4:
42664274 version "1.7.4"
42674275 resolved "https://registry.yarnpkg.com/compression/-/compression-1.7.4.tgz#95523eff170ca57c29a0ca41e6fe131f41e5bb8f"
You can’t perform that action at this time.
0 commit comments