为什么加了exclude之后就报了很多错误呢?
为什么加了exclude之后就报了很多错误呢? 这样写: exclude:__dirname+'/node_modules/', 这样写: exclude:'./node_modules/', 这样写: exclude:__dirname+/node_modules/, 这样写: exclude:/node_modules/, 都不行 错误如下:
Invalid configuration object. Webpack has been initialised using a configur
object that does not match the API schema.
- configuration.module.rules[0].use should be one of these:
non-empty string | function | object { loader?, options?, query? } | fun
| [non-empty string | function | object { loader?, options?, query? }]
Details:
* configuration.module.rules[0].use should be a string.
* configuration.module.rules[0].use should be an instance of function.
* configuration.module.rules[0].use has an unknown property 'exclude'.
properties are valid:
object { loader?, options?, query? }
* configuration.module.rules[0].use has an unknown property 'include'.
properties are valid:
object { loader?, options?, query? }
* configuration.module.rules[0].use should be one of these:
non-empty string | function | object { loader?, options?, query? }
* configuration.module.rules[0].use should be an instance of function.
* configuration.module.rules[0].use should be an array:
[non-empty string | function | object { loader?, options?, query? }]