<PLEASE USE THIS TEMPLATE TO HELP YOU CREATE A GREAT POST!>
<Below this line, add a link to the EXACT exercise that you are stuck at.>
https://www.codecademy.com/articles/react-setup-v
<Below this line, in what way does your code behave incorrectly? Include ALL error messages.>
I can’t compile the React app. This is what I got in the terminal:
webpack.config.js
var HTMLWebpackPlugin = require('html-webpack-plugin');
var HTMLWebPackPluginConfig = new
HTMLWebpackPlugin({
template: __dirname + '/app/index.html',
filename: 'index.html',
inject: 'body'
});
module.exports = {
entry: __dirname + '/app/index.js',
module: {
loader: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader'
}
]
},
output: {
filename: 'transformed.js',
path: __dirname + '/build'
},
plugins:[HTMLWebPackPluginConfig]
};
package.json
{
"name": "example",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"build":"webpack",
"start":"webpack-dev-server"
},
"author": "",
"license": "ISC",
"dependencies": {
"react": "^15.3.0",
"react-dom": "^15.3.0"
},
"devDependencies": {
"babel-core": "^6.13.2",
"babel-loader": "^6.2.4",
"babel-preset-react": "^6.11.1",
"html-webpack-plugin": "^2.22.0",
"i": "^0.3.5",
"webpack": "^1.13.1",
"webpack-dev-server": "^1.14.1"
}
}
Problem solved I accidently type loader instead of loaders in webconfig