Skip to content

Commit

Permalink
Fix: Switch from uglify to terser plugin
Browse files Browse the repository at this point in the history
Updating js minifier to terser because uglify removes class name, probably due to some dependant module change, and that broke our event handling logic: 
we used to use full class names to bind to events but now those classes names are minified to 'e' or 'r' etc.
Probably issue: webpack-contrib/uglifyjs-webpack-plugin#269
  • Loading branch information
bainternet committed Sep 4, 2019
1 parent 81fced7 commit cf46deb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions .grunt-config/webpack.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/
const path = require( 'path' );

const UglifyJsPlugin = require( 'uglifyjs-webpack-plugin' );
const TerserPlugin = require( 'terser-webpack-plugin' );

const aliasList = {
alias: {
Expand Down Expand Up @@ -112,7 +112,10 @@ const webpackProductionConfig = {
optimization: {
minimize: true,
minimizer: [
new UglifyJsPlugin( {
new TerserPlugin( {
terserOptions: {
keep_fnames: true,
},
include: /\.min\.js$/
} ),
],
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
"grunt-checktextdomain": "~1.0.1",
"grunt-contrib-clean": "~1.1.0",
"grunt-contrib-copy": "~1.0.0",
"grunt-contrib-sass": "~1.0.0",
"grunt-contrib-qunit": "^3.1.0",
"grunt-contrib-sass": "~1.0.0",
"grunt-contrib-watch": "^1.1.0",
"grunt-postcss": "~0.9.0",
"grunt-release": "~0.14.0",
Expand All @@ -48,7 +48,7 @@
"load-grunt-tasks": "^4.0.0",
"mini-css-extract-plugin": "^0.4.3",
"path": "^0.12.7",
"uglifyjs-webpack-plugin": "^1.3.0",
"terser-webpack-plugin": "^1.4.1",
"webpack": "^4.16.5"
},
"dependencies": {
Expand Down

0 comments on commit cf46deb

Please sign in to comment.