diff --git a/package.json b/package.json index b39779db..d052e05d 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "babel-preset-es2015": "^6.24.1", "buffer-loader": "0.0.1", "canvas-toBlob": "1.0.0", - "copy-webpack-plugin": "4.2.1", + "copy-webpack-plugin": "^4.5.1", "decode-html": "2.0.0", "escape-html": "1.0.3", "eslint": "^4.5.0", @@ -67,8 +67,9 @@ "tap": "^11.0.1", "text-encoding": "0.6.4", "tiny-worker": "^2.1.1", - "webpack": "^3.10.0", - "webpack-dev-server": "^2.4.1", - "worker-loader": "1.1.0" + "webpack": "4", + "webpack-cli": "^2.0.15", + "webpack-dev-server": "^3.1.3", + "worker-loader": "^1.1.1" } } diff --git a/webpack.config.js b/webpack.config.js index ad40a58b..ec539c49 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,9 +1,10 @@ const CopyWebpackPlugin = require('copy-webpack-plugin'); const defaultsDeep = require('lodash.defaultsdeep'); 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', @@ -28,12 +29,14 @@ const base = { loader: 'file-loader' }] }, - 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 = [ @@ -129,6 +132,9 @@ module.exports = [ } ]) }, + performance: { + hints: false + }, plugins: base.plugins.concat([ new CopyWebpackPlugin([{ from: 'node_modules/scratch-blocks/media',