【发布时间】:2015-09-27 23:17:27
【问题描述】:
我在我的 gruntfile.js 中使用 grunt-postcss 并且一切正常,除了 postcss-bem-linter 如果不遵循 BEM 规则,它应该在控制台中记录警告。这里是 gruntfile.js 中的一个 sn-p 配置:
var preprocessorsAfterSprites = [
require('postcss-bem-linter')(function (a) {
console.log(a);
}), // this just doesn't want to work right now
require('postcss-reporter')
];
function getPostCssPreprocessors(name) {
return preprocessorsAfterSprites;
}
grunt.initConfig({
postcss: {
options: {
map: { inline: false }
},
golden: {
src: '<%= dirs.pcss %>/golden/main.scss',
dest: '<%= dirs.css %>/golden.css',
options: {
processors: getPostCssPreprocessors('golden')
}
}
}
});
当我尝试输入 grunt postcss:golden 时,控制台日志没有任何输出。任何想法为什么?
【问题讨论】:
标签: javascript gruntjs gruntfile