Closed niksy closed 8 years ago
Just saw postcss-reporter which collects warnings and errors from plugins so I suppose all console statements could be transfered to PostCSS warn/error methods to make them more flexible?
I agree, this will allow us to do things like
var postcss = require('postcss');
var sprites = require('postcss-sprites').default;
var report = require('postcss-reporter');
postcss([
sprites(),
report({
filter: function(message) {
return !/data:image\/.+;base64/.test(message.text);
}
})
]);
The base64 image logs are especially noisy as they dump the entire binary out into the console.
Here's all it would take https://github.com/ianstarz/postcss-sprites/commit/938ed76b1d5d6419482b032a29cb8bef7dc6a82d
@niksy, @ianstarz sorry for late response but I was busy at work. I will do the transition to Result.warn
API to allow easier reporting of the warnings.
Would you consider adding option to disable console warnings (i.e.
postcss-sprites: Skip assets/images/image.png because doesn't exist.
)? Complicated build processes which contain image URL rewriting before postcss-sprites does it’s work make it really "loud" in CLI :)