Skip to content

Commit 49809df

Browse files
committed
updated minimization in production
1 parent 8e0bb6f commit 49809df

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

package-lock.json

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,10 @@
3232
"classnames": "^2.3.2",
3333
"cross-env": "^7.0.3",
3434
"css-loader": "^6.8.1",
35+
"css-minimizer-webpack-plugin": "^5.0.1",
3536
"file-loader": "^6.2.0",
3637
"locks": "^0.2.2",
3738
"mini-css-extract-plugin": "^2.7.6",
38-
"sass": "^1.69.5",
39-
"css-minimizer-webpack-plugin": "^5.0.1",
4039
"postcss-loader": "^7.3.3",
4140
"prop-types": "^15.7.2",
4241
"react": "^18.2.0",
@@ -45,8 +44,10 @@
4544
"react-router": "^6.17.0",
4645
"react-router-dom": "^6.17.0",
4746
"resolve-url-loader": "^5.0.0",
47+
"sass": "^1.69.5",
4848
"sass-loader": "^13.3.2",
4949
"style-loader": "^3.3.3",
50+
"terser-webpack-plugin": "^5.3.9",
5051
"webpack": "^5.89.0",
5152
"webpack-cli": "^5.1.4",
5253
"webpack-fix-style-only-entries": "^0.6.1"

webpack.config.js

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const path = require('path');
22
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
3+
const TerserPlugin = require('terser-webpack-plugin');
34

45
module.exports = (env, argv) => {
56
const isProduction = argv.mode === 'production';
@@ -126,12 +127,14 @@ module.exports = (env, argv) => {
126127
},
127128
plugins: [new MiniCssExtractPlugin()],
128129
optimization: {
130+
minimize: isProduction,
129131
minimizer: [
130132
new MiniCssExtractPlugin(
131133
{
132134
filename: "[name].css"
133135
}
134136
),
137+
new TerserPlugin()
135138
],
136139
}
137140
}

0 commit comments

Comments
 (0)