vue-cli中的stylus问题
来源:4-8 Dropdown 组件基本功能编码
有没有没被占用的昵称
2020-11-19
老师,我使用vue-cli创建了一个vue3.0项目,没有使用router和vuex,加入了jsx的支持,后来引入了stylus和stylus-loader,然后就出现了报错,我没有进行任何配置,都是使用的vue-cli的默认配置
in ./src/App.vue?vue&type=style&index=0&id=7ba5bd90&lang=stylus&scoped=true
Module build failed (from ./node_modules/stylus-loader/dist/cjs.js):
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? }
at validate (/Users/wangxin/source/vue3/vue-json-scheam-form/node_modules/stylus-loader/node_modules/schema-utils/dist/validate.js:104:11)
at Object.stylusLoader (/Users/wangxin/source/vue3/vue-json-scheam-form/node_modules/stylus-loader/dist/index.js:24:29)
@ ./node_modules/vue-style-loader??ref–11-oneOf-1-0!./node_modules/css-loader/dist/cjs.js??ref–11-oneOf-1-1!./node_modules/vue-loader-v16/dist/stylePostLoader.js!./node_modules/postcss-loader/src??ref–11-oneOf-1-2!./node_modules/stylus-loader/dist/cjs.js??ref–11-oneOf-1-3!./node_modules/cache-loader/dist/cjs.js??ref–0-0!./node_modules/vue-loader-v16/dist??ref–0-1!./src/App.vue?vue&type=style&index=0&id=7ba5bd90&lang=stylus&scoped=true 4:14-438 14:3-18:5 15:22-446
@ ./src/App.vue?vue&type=style&index=0&id=7ba5bd90&lang=stylus&scoped=true
@ ./src/App.vue
@ ./src/main.ts
@ multi (webpack)-dev-server/client?http://172.20.188.238:8080&sockPath=/sockjs-node (webpack)/hot/dev-server.js ./src/main.ts
options has an unknown property ‘preferPathResolver’. 针对我这行报错,我发现是vue-cli默认的webpack配置文件中写的,但是我之前的项目中都是这样的,也没有报错呀
1回答
-
同学你好 在 github 找到了这个 issue, https://github.com/vuejs/vue-cli/issues/5947 和你描述的一摸一样,现在暂时使用 stylus-loader v3 就没问题了。你可以在 issue 中查看详情。
022020-11-20
相似问题