这是代码:
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
]
这是错误日志:
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.
似乎每个.vue
文件都出现相同的错误?...
答案 0 :(得分:0)
您无法将自定义解析器作为插件传递。您的配置应如下所示:
postcss: {
options: {
parser: require('postcss-scss')
},
plugins: [
require('postcss-cssnext')(),
require('precss')()
]
}