[英]How can I use precss in vue-loader at a vue-cli programme?
Here is code: 这是代码:
postcss: [
require('postcss-cssnext')(), // postcss is working fine if I only write this row.
require('precss')().process({ parser: require('postcss-scss') }) // npm got error when I add this row
]
Here is error log: 这是错误日志:
Module build failed: Error: PostCSS syntaxes cannot be used as plugins.
Instead, please use one of the syntax/parser/stringifier options as
outlined in your PostCSS runner documentation.
It seems every .vue
file got same error?... 似乎每个
.vue
文件都有相同的错误?...
You cannot pass a custom parser in as a plugin. 您不能将自定义解析器作为插件传入。 Your config should look like this:
您的配置应如下所示:
postcss: {
options: {
parser: require('postcss-scss')
},
plugins: [
require('postcss-cssnext')(),
require('precss')()
]
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.