improve (speed): support for brotli compression

This commit is contained in:
Mickael Kerjean
2019-05-09 00:43:05 +10:00
parent 5c0cd37f77
commit 7f34aaea2c
2 changed files with 23 additions and 1 deletions

View File

@ -82,6 +82,13 @@ if (process.env.NODE_ENV === 'production') {
threshold: 0,
minRatio: 0.8
}));
config.plugins.push(new CompressionPlugin({
asset: "[path].br[query]",
algorithm: "brotliCompress",
test: /\.js$|\.json$|\.html$|\.svg|\.ico$/,
threshold: 0,
minRatio: 0.8
}));
} else {
config.devtool = '#inline-source-map';
}