Skip to content

Commit

Permalink
Gzip compression implemented in build script.
Browse files Browse the repository at this point in the history
  • Loading branch information
fwaalkens authored and martinbosma committed Feb 22, 2024
1 parent f7e6227 commit 793fc13
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 2 deletions.
4 changes: 4 additions & 0 deletions config/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const getClientEnvironment = require("./env")
const ModuleNotFoundPlugin = require("react-dev-utils/ModuleNotFoundPlugin")
const ForkTsCheckerWebpackPlugin = require("react-dev-utils/ForkTsCheckerWebpackPlugin")
const ReactRefreshWebpackPlugin = require("@pmmmwh/react-refresh-webpack-plugin")
const CompressionPlugin = require("compression-webpack-plugin");

const appPackageJson = require(paths.appPackageJson)

Expand Down Expand Up @@ -683,6 +684,9 @@ module.exports = function (webpackEnv) {
new webpack.optimize.LimitChunkCountPlugin({
maxChunks: 1,
}),
new CompressionPlugin({
threshold: 500000,
})
].filter(Boolean),
// Turn off performance processing because we utilize
// our own hints via the FileSizeReporter
Expand Down
79 changes: 77 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@
"@types/react-dom": "^17.0.18",
"@wojtekmaj/enzyme-adapter-react-17": "^0.6.0",
"autoprefixer": "^10.4.13",
"compression-webpack-plugin": "^11.0.0",
"css-loader": "^6.7.3",
"css-minimizer-webpack-plugin": "^4.2.2",
"cypress": "^13.6.0",
Expand Down

0 comments on commit 793fc13

Please sign in to comment.