updated minimization in production

This commit is contained in:
knox
2023-10-29 19:24:16 +01:00
parent 8e0bb6f28a
commit 49809dfeab
3 changed files with 7 additions and 2 deletions

1
package-lock.json generated
View File

@@ -43,6 +43,7 @@
"sass": "^1.69.5",
"sass-loader": "^13.3.2",
"style-loader": "^3.3.3",
"terser-webpack-plugin": "^5.3.9",
"webpack": "^5.89.0",
"webpack-cli": "^5.1.4",
"webpack-fix-style-only-entries": "^0.6.1"

View File

@@ -32,11 +32,10 @@
"classnames": "^2.3.2",
"cross-env": "^7.0.3",
"css-loader": "^6.8.1",
"css-minimizer-webpack-plugin": "^5.0.1",
"file-loader": "^6.2.0",
"locks": "^0.2.2",
"mini-css-extract-plugin": "^2.7.6",
"sass": "^1.69.5",
"css-minimizer-webpack-plugin": "^5.0.1",
"postcss-loader": "^7.3.3",
"prop-types": "^15.7.2",
"react": "^18.2.0",
@@ -45,8 +44,10 @@
"react-router": "^6.17.0",
"react-router-dom": "^6.17.0",
"resolve-url-loader": "^5.0.0",
"sass": "^1.69.5",
"sass-loader": "^13.3.2",
"style-loader": "^3.3.3",
"terser-webpack-plugin": "^5.3.9",
"webpack": "^5.89.0",
"webpack-cli": "^5.1.4",
"webpack-fix-style-only-entries": "^0.6.1"

View File

@@ -1,5 +1,6 @@
const path = require('path');
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const TerserPlugin = require('terser-webpack-plugin');
module.exports = (env, argv) => {
const isProduction = argv.mode === 'production';
@@ -126,12 +127,14 @@ module.exports = (env, argv) => {
},
plugins: [new MiniCssExtractPlugin()],
optimization: {
minimize: isProduction,
minimizer: [
new MiniCssExtractPlugin(
{
filename: "[name].css"
}
),
new TerserPlugin()
],
}
}