Invalid Configuration object


I followed the steps which are given codecademy’s react environmental setup , but i get this error : "Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema. - configuration has an unknown property ‘text’ "
Could you guys please help me with this last step of configuration ?
Thanks in advance.


I changed “loaders” to “rules” and it worked for me! I found the answer here:

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: {
        rules: [
                test: /\.js$/,
                exclude: /node_modules/,
                loader: 'babel-loader'
    output: {
        filename: 'transformed.js',
        path: __dirname + '/build'
    plugins: [HTMLWebpackPluginConfig]