Skip to content

Commit

Permalink
updated minimization in production
Browse files Browse the repository at this point in the history
  • Loading branch information
knoxfighter committed Oct 29, 2023
1 parent 8e0bb6f commit 49809df
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions package-lock.json

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

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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"
Expand Down
3 changes: 3 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -126,12 +127,14 @@ module.exports = (env, argv) => {
},
plugins: [new MiniCssExtractPlugin()],
optimization: {
minimize: isProduction,
minimizer: [
new MiniCssExtractPlugin(
{
filename: "[name].css"
}
),
new TerserPlugin()
],
}
}
Expand Down

0 comments on commit 49809df

Please sign in to comment.