Reputation: 77
Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
- configuration.module.rules[0] has an unknown property 'option'. These properties are valid: object { compiler?, enforce?, exclude?, include?, issuer?, loader?, loaders?, oneOf?, options?, parser?, query?, resolve?, resource?, resourceQuery?, rules?, sideEffects?, test?, type?, use? } -> A rule npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! [email protected] webpack: `webpack` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] webpack script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Upvotes: 4
Views: 10135
Reputation: 566
You have a typo here, you should have options instead of option in your module -> rules -> use :)
Should be something like this:
rules: [
{
test: /\.jsx?$/, // compilation to es6
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
presets: ['react', 'es2015', 'es2016', 'stage-0'],
plugins: ['syntax-dynamic-import'],
},
},
},
]
Upvotes: 9