self-taught to use the configuration file from a tutorial of webpack,copy a year ago, but it seems that the new version does not support the old writing. My configuration file is as follows:
module.exports = {
entry: "./app.js",
output: {
filename: "bundle.js"
},
module: {
loaders:[
{
test: /\.js[x]?$/,
exclude: /node_modules/,
loader: "babel-loader?presets[]=es2015&presets[]=react"
},
]
}
}
the error message is as follows:
Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
- configuration.module has an unknown property "loaders". These properties are valid:
object { exprContextCritical?, exprContextRecursive?, exprContextRegExp?, exprContextRequest?, noParse?, rules?, defaultRules?, unknownContextCritical?, unknownContextRecursive?, unknownContextRegExp?, unknownContextRequest?, unsafeCache?, wrappedContextCritical?, wrappedContextRecursive?, wrappedContextRegExp?, strictExportPresence?, strictThisContextOnImports? }
-> Options affecting the normal modules (`NormalModuleFactory`).
ask for expert advice