diff --git a/package.json b/package.json index 9f410c2c7..f85e13cbe 100644 --- a/package.json +++ b/package.json @@ -26,12 +26,11 @@ "devDependencies": { "babel-core": "^6.23.1", "babel-eslint": "^8.2.1", - "babel-loader": "^7.1.2", + "babel-loader": "^7.1.4", "babel-polyfill": "^6.22.0", "babel-preset-es2015": "^6.22.0", - "base64-loader": "^1.0.0", "chromeless": "^1.5.1", - "copy-webpack-plugin": "^4.0.1", + "copy-webpack-plugin": "^4.5.1", "docdash": "^0.4.0", "eslint": "^4.6.1", "eslint-config-scratch": "^5.0.0", @@ -49,8 +48,10 @@ "tap": "^11.0.0", "travis-after-all": "^1.4.4", "twgl.js": "4.4.0", - "webpack": "^3.10.0", - "webpack-dev-server": "^2.8.2", + "uglifyjs-webpack-plugin": "^1.2.5", + "webpack": "^4.8.0", + "webpack-cli": "^2.0.15", + "webpack-dev-server": "^3.1.4", "xml-escape": "1.1.0" } } diff --git a/webpack.config.js b/webpack.config.js index e380f0563..c1a8c0e7a 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,8 +1,9 @@ const CopyWebpackPlugin = require('copy-webpack-plugin'); const path = require('path'); -const webpack = require('webpack'); +const UglifyJsPlugin = require('uglifyjs-webpack-plugin'); const base = { + mode: process.env.NODE_ENV === 'production' ? 'production' : 'development', devServer: { contentBase: false, host: '0.0.0.0', @@ -27,12 +28,14 @@ const base = { } ] }, - plugins: process.env.NODE_ENV === 'production' ? [ - new webpack.optimize.UglifyJsPlugin({ - include: /\.min\.js$/, - minimize: true - }) - ] : [] + optimization: { + minimizer: [ + new UglifyJsPlugin({ + include: /\.min\.js$/ + }) + ] + }, + plugins: [] }; module.exports = [