Invalid Configuration object


#1

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.


#2

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

https://stackoverflow.com/questions/49203841/webpack-4-1-1-configuration-module-has-an-unknown-property-loaders

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]
};