From 7a963f1a41b86cce07a1c3c613dbbf7045f3a461 Mon Sep 17 00:00:00 2001 From: Michael Dwyer Date: Mon, 23 Jan 2017 13:42:09 -0800 Subject: [PATCH] Upgrade to webpack 2.0, implement treeshaking --- package.json | 10 +++++----- webpack.config.js | 23 +++++++++++++++++++++-- 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 26afe8e..92170f0 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { - "name": "inventive-ironwood", + "name": "Moneyio", "version": "1.0.0", - "description": "> Pithy project description", + "description": "", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", @@ -44,14 +44,14 @@ "request": "^2.79.0", "sequelize": "^3.27.0", "sqlite3": "^3.1.8", - "victory": "^0.14.2", - "webpack": "^1.14.0" + "victory": "^0.14.2" }, "devDependencies": { "babel-cli": "^6.6.5", "babel-core": "^6.18.2", "babel-preset-es2015": "^6.6.0", "babel-preset-react": "^6.5.0", - "babel-watch": "^2.0.3" + "babel-watch": "^2.0.3", + "webpack": "^2.2.0" } } diff --git a/webpack.config.js b/webpack.config.js index 5164347..c019d55 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -15,10 +15,29 @@ var config = { { test : /\.jsx?/, include : APP_DIR, - loader : 'babel' + loader : 'babel-loader' } ] - } + }, + plugins: [ + new webpack.LoaderOptionsPlugin({ + minimize: true, + debug: false + }), + new webpack.optimize.UglifyJsPlugin({ + compress: { + warnings: false, + conditionals: true, + unused: true, + comparisons: true, + sequences: true, + dead_code: true, + evaluate: true, + if_return: true, + join_vars: true, + }, + }) + ] }; module.exports = config; \ No newline at end of file