From 3df05984f7c72295e3bca23bf9f616e91b8c64b6 Mon Sep 17 00:00:00 2001 From: Eduardo Nogueira <1110512@isep.ipp.pt> Date: Mon, 27 Feb 2017 23:26:47 +0000 Subject: [PATCH] Update tutorial solution to webpack v2. --- package.json | 28 ++++++++++++---------------- webpack.config.js | 10 +++++----- 2 files changed, 17 insertions(+), 21 deletions(-) diff --git a/package.json b/package.json index 02cf643..8e17062 100644 --- a/package.json +++ b/package.json @@ -4,27 +4,23 @@ "description": "", "main": "index.js", "scripts": { - "start": "node server" + "test": "echo \"Error: no test specified\" && exit 1" }, "keywords": [], - "author": "Michael Cheng (http://michaelcheng.io)", + "author": "", "license": "ISC", "dependencies": { - "express": "^4.13.4", - "lodash": "^4.2.1", - "react": "^0.14.7", - "react-dom": "^0.14.7" + "lodash": "^4.17.4", + "react": "^15.4.2", + "react-dom": "^15.4.2" }, "devDependencies": { - "babel-core": "^6.4.5", - "babel-loader": "^6.2.2", - "babel-preset-es2015": "^6.3.13", - "babel-preset-react": "^6.3.13", - "react-hot-loader": "^1.3.0", - "webpack": "^1.12.13", - "webpack-dev-server": "^1.14.1" - }, - "engines": { - "node": "5.5.0" + "babel-core": "^6.23.1", + "babel-loader": "^6.3.2", + "babel-preset-es2015": "^6.22.0", + "babel-preset-react": "^6.23.0", + "react-hot-loader": "^1.3.1", + "webpack": "^2.2.1", + "webpack-dev-server": "^2.4.1" } } diff --git a/webpack.config.js b/webpack.config.js index 49edf54..612be54 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -13,20 +13,20 @@ module.exports = { filename: 'bundle.js' }, resolve: { - modulesDirectories: ['node_modules', 'src'], - extensions: ['', '.js'] + modules: ['node_modules', 'src'], + extensions: ['.js'] }, module: { loaders: [ { test: /\.jsx?$/, exclude: /node_modules/, - loaders: ['react-hot', 'babel?presets[]=react,presets[]=es2015'] + loaders: ['react-hot-loader', 'babel-loader?presets[]=react,presets[]=es2015'] } ] }, plugins: [ new webpack.HotModuleReplacementPlugin(), - new webpack.NoErrorsPlugin() + new webpack.NoEmitOnErrorsPlugin() ] -}; +}; \ No newline at end of file