Skip to content

Commit

Permalink
Replacing UglifyJsPlugin with TerserPlugin
Browse files Browse the repository at this point in the history
  • Loading branch information
craigstroman committed Jan 11, 2021
1 parent d668499 commit 78262e0
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions webpack.config.prod.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
const path = require('path');
const webpack = require('webpack');
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
const TerserPlugin = require('terser-webpack-plugin');
const Dotenv = require('dotenv-webpack');
const { faLeaf } = require('@fortawesome/free-solid-svg-icons');

const filePath = path.join(__dirname, './public/js/');
const fileName = 'main.min.js';
const PATHS = {
src: path.join(__dirname, './src/'),
Expand Down Expand Up @@ -31,8 +31,14 @@ module.exports = {

optimization: {
minimizer: [
new UglifyJsPlugin({
new TerserPlugin({
cache: true,
parallel: true,
terserOptions: {
compress: true,
emca: 6,
mangle: true,
},
sourceMap: false,
}),
],
Expand Down Expand Up @@ -75,7 +81,7 @@ module.exports = {
},
],
},
]
],
},

plugins: [
Expand All @@ -86,4 +92,4 @@ module.exports = {
}),
new Dotenv(),
],
}
};

0 comments on commit 78262e0

Please sign in to comment.