React Setup - ERROR in ./app/index.js -- SOLVED


#1

https://www.codecademy.com/articles/react-setup-v

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


#2

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.