Description: use webpack 4

--- a/webpack.config.js
+++ b/webpack.config.js
@@ -1,5 +1,6 @@
 var webpack = require('webpack');
 var path = require('path');
+var UglifyJsPlugin = require('uglifyjs-webpack-plugin');
 var config = {};
 
 function generateConfig(name) {
@@ -24,6 +25,22 @@
 
     resolveLoader: {
       modules: ['/usr/lib/nodejs', '/usr/share/nodejs'],
+    },
+
+    optimization: {
+      minimizer: [
+        // we specify a custom UglifyJsPlugin here to get source maps in production
+        new UglifyJsPlugin({
+          cache: true,
+          parallel: true,
+          uglifyOptions: {
+            compress: false,
+            ecma: 6,
+            mangle: true
+          },
+          sourceMap: true
+        })
+      ]
     }
   };
 
@@ -33,14 +50,6 @@
     })
   ];
 
-  if (uglify) {
-    config.plugins.push(
-      new webpack.optimize.UglifyJsPlugin({
-        sourceMap: true
-      })
-    );
-  }
-
   return config;
 }
 
