Skip to content

Commit

Permalink
feat: TerserPlugin
Browse files Browse the repository at this point in the history
  • Loading branch information
Ciro Cesar Maciel committed Mar 11, 2021
1 parent be7375f commit 7c8807f
Show file tree
Hide file tree
Showing 3 changed files with 245 additions and 4 deletions.
9 changes: 8 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const path = require("path");
const webpack = require("webpack");
const Dotenv = require("dotenv-webpack");
const { merge } = require("webpack-merge");
const TerserPlugin = require("terser-webpack-plugin");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const { CleanWebpackPlugin } = require("clean-webpack-plugin");
const CompressionPlugin = require("compression-webpack-plugin");
Expand Down Expand Up @@ -126,7 +127,13 @@ const prodConfig = (dirPath) => ({
},
optimization: {
minimize: true,
minimizer: [new CssMinimizerPlugin({ parallel: 4, sourceMap: false })],
minimizer: [
new TerserPlugin({
parallel: 4,
sourceMap: false,
}),
new CssMinimizerPlugin({ parallel: 4, sourceMap: false }),
],
},
plugins: [
new FaviconsWebpackPlugin({
Expand Down
239 changes: 236 additions & 3 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 @@ -57,6 +57,7 @@
"prettier": "^2.2.1",
"progress-bar-webpack-plugin": "^2.1.0",
"style-loader": "^2.0.0",
"terser-webpack-plugin": "^5.1.1",
"webpack": "^5.24.4",
"webpack-bundle-analyzer": "^4.4.0",
"webpack-cli": "^4.5.0",
Expand Down

0 comments on commit 7c8807f

Please sign in to comment.