From 2ade375c204301dfbc4121f1e47d1c191d8c89e1 Mon Sep 17 00:00:00 2001 From: Devin Howard Date: Sun, 25 Sep 2016 21:53:26 +0800 Subject: [PATCH 1/2] babel-plugin-lodash to slim down bundle size by 300 KB --- .babelrc | 1 + package.json | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.babelrc b/.babelrc index 2ad52bf1..f9151299 100644 --- a/.babelrc +++ b/.babelrc @@ -4,6 +4,7 @@ "es2015" ], "plugins": [ + "lodash", "transform-class-properties" ] } diff --git a/package.json b/package.json index aa2caef9..02dc7237 100644 --- a/package.json +++ b/package.json @@ -21,17 +21,18 @@ "autolinker": "0.17.1", "babel-cli": "6.11.4", "babel-loader": "6.2.4", + "babel-plugin-lodash": "^3.2.9", "babel-plugin-transform-class-properties": "6.11.5", "babel-preset-es2015": "6.9.0", "babel-preset-react": "6.11.1", "backbone": "1.0.0", "csv-parse": "1.1.7", + "lodash": "4.16.1", "node-uuid": "1.2.0", "react": "15.3.0", "react-dom": "15.3.0", "requirejs": "2.1.1", "socket.io": "0.9.12", - "underscore": "1.4.4", "webpack": "1.13.1" }, "devDependencies": { From 0df17c4aa05dfbe44cc2201e2303449e2dc6580f Mon Sep 17 00:00:00 2001 From: Devin Howard Date: Sun, 25 Sep 2016 21:53:40 +0800 Subject: [PATCH 2/2] update deps in package.json --- package.json | 15 +++++++-------- webpack.config.js | 1 + 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 02dc7237..b71e34bf 100644 --- a/package.json +++ b/package.json @@ -19,21 +19,20 @@ "homepage": "https://github.com/metamaps/metamaps#readme", "dependencies": { "autolinker": "0.17.1", - "babel-cli": "6.11.4", - "babel-loader": "6.2.4", + "babel-cli": "6.14.0", + "babel-loader": "6.2.5", "babel-plugin-lodash": "^3.2.9", "babel-plugin-transform-class-properties": "6.11.5", - "babel-preset-es2015": "6.9.0", + "babel-preset-es2015": "6.14.0", "babel-preset-react": "6.11.1", "backbone": "1.0.0", "csv-parse": "1.1.7", "lodash": "4.16.1", - "node-uuid": "1.2.0", - "react": "15.3.0", - "react-dom": "15.3.0", - "requirejs": "2.1.1", + "node-uuid": "1.4.7", + "react": "15.3.2", + "react-dom": "15.3.2", "socket.io": "0.9.12", - "webpack": "1.13.1" + "webpack": "1.13.2" }, "devDependencies": { "chai": "^3.5.0", diff --git a/webpack.config.js b/webpack.config.js index 87881667..fcdcbc04 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -9,6 +9,7 @@ const plugins = [ }) ] if (NODE_ENV === 'production') { + plugins.push(new webpack.optimize.DedupePlugin()) plugins.push(new webpack.optimize.UglifyJsPlugin({ compress: { warnings: false } }))