postcss-critical-split
Version:
A PostCSS plugin that takes existing CSS files and splits out the annotated critical styles into a seperate file.
14 lines (10 loc) • 320 B
JavaScript
var postcss = require('postcss');
module.exports = function(criticalSplit, input, output, opts) {
spyOn(console, 'error').and.callFake(function(message){
// do nothing
});
return postcss([criticalSplit(opts)]).process(input)
.then( function(result) {
expect(console.error).toHaveBeenCalledTimes(1);
});
}