报错信息如下:
Syntax Error: ValidationError: Invalid options object. Stylus Loader has been initialized using an options object that does not match the API schema. - options has an unknown property 'preferPathResolver'. These properties are valid: object { stylusOptions?, sourceMap?, webpackImporter?, additionalData? }
原因是安装的stylus是最新版本的,网上的信息说换一个版本就可以解决。
最后解决方案:
1.cnpm install stylus --save-dev
2.stylus -V
3.cnpm install stylus stylus-loader --save-dev
4.修改package.json
"stylus": "^0.54.5", "stylus-loader": "^3.0.2",
问题解决了!