diff --git a/package.json b/package.json index 4a2e287..5977d9c 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "audio-context": "1.0.1", "babel-core": "^6.24.1", "babel-eslint": "^7.2.2", - "babel-loader": "^6.4.1", + "babel-loader": "^7.1.4", "babel-preset-es2015": "^6.24.1", "eslint": "^3.19.0", "eslint-config-scratch": "^3.1.0", @@ -33,6 +33,7 @@ "soundfont-player": "0.10.5", "startaudiocontext": "1.2.1", "travis-after-all": "^1.4.4", - "webpack": "2.4.0" + "webpack": "^4.8.0", + "webpack-cli": "^2.0.15" } } diff --git a/webpack.config.js b/webpack.config.js index 1494ecd..014e051 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,6 +1,7 @@ var path = require('path'); module.exports = { + mode: process.env.NODE_ENV === 'production' ? 'production' : 'development', devtool: 'cheap-module-source-map', entry: { dist: './src/index.js' @@ -12,11 +13,11 @@ module.exports = { filename: '[name].js' }, module: { - loaders: [{ + rules: [{ test: /\.js$/, - loader: 'babel-loader', include: path.resolve(__dirname, 'src'), - query: { + loader: 'babel-loader', + options: { presets: ['es2015'] } }]