不完美
2017-07-03 17:32
为什么加了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? }]
把exclude配置再option目录下面,可不配置绝对路径
使用绝对路径
exclude: __dirname +'./node_modules/'
错哪里了
好吧,知道错哪里了
webpack深入与实战
86558 学习 · 721 问题
相似问题