From fea46d17fe982dc678eec0f3e5f61a38fa8a688a Mon Sep 17 00:00:00 2001 From: Pavel Djundik Date: Sun, 19 Mar 2017 10:02:39 +0200 Subject: [PATCH] Do not build json3 and debug modules --- package.json | 5 +++-- webpack.config.js | 9 +++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index ce8a9b9845..a50747afad 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "start-dev": "npm-run-all --parallel watch start", "build": "npm-run-all build:*", "build:font-awesome": "node scripts/build-fontawesome.js", - "build:webpack": "webpack", + "build:webpack": "webpack --progress", "watch": "webpack --watch", "test": "npm-run-all -c test:* lint", "test:mocha": "mocha", @@ -75,6 +75,7 @@ "socket.io-client": "1.7.3", "stylelint": "7.9.0", "urijs": "1.18.9", - "webpack": "2.2.1" + "webpack": "2.2.1", + "webpack-remove-debug": "0.1.0" } } diff --git a/webpack.config.js b/webpack.config.js index 09c365619d..1fd3522e29 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -27,6 +27,12 @@ let config = { }, module: { rules: [ + { + test: /\.js$/, + use: { + loader: "webpack-remove-debug" + } + }, { test: /\.js$/, include: [ @@ -60,6 +66,9 @@ let config = { }, ] }, + externals: { + json3: "JSON", // socket.io uses json3.js, but we do not target any browsers that need it + }, plugins: [ new webpack.optimize.CommonsChunkPlugin("js/bundle.vendor.js") ]