mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-20 06:55:08 -04:00
Webpack compress with gzip and brotli
This commit is contained in:
parent
3822c6c520
commit
304266020d
3 changed files with 40 additions and 0 deletions
|
@ -1,8 +1,10 @@
|
|||
const webpack = require("webpack");
|
||||
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
|
||||
const CompressionPlugin = require("compression-webpack-plugin");
|
||||
const CopyWebpackPlugin = require("copy-webpack-plugin");
|
||||
const { ModifySourcePlugin, ReplaceOperation } = require("modify-source-webpack-plugin");
|
||||
const path = require("path");
|
||||
const zlib = require("zlib");
|
||||
|
||||
/**
|
||||
* Webpack configuration details for use with Grunt.
|
||||
|
@ -64,6 +66,21 @@ module.exports = {
|
|||
new MiniCssExtractPlugin({
|
||||
filename: "assets/[name].css"
|
||||
}),
|
||||
new CompressionPlugin({
|
||||
filename: "[path][base].gz",
|
||||
algorithm: "gzip",
|
||||
test: /\.(js|css|html)$/,
|
||||
}),
|
||||
new CompressionPlugin({
|
||||
filename: "[path][base].br",
|
||||
algorithm: "brotliCompress",
|
||||
test: /\.(js|css|html)$/,
|
||||
compressionOptions: {
|
||||
params: {
|
||||
[zlib.constants.BROTLI_PARAM_QUALITY]: 11,
|
||||
},
|
||||
},
|
||||
}),
|
||||
new CopyWebpackPlugin({
|
||||
patterns: [
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue