Answer the question
In order to leave comments, you need to log in
Event-Driven Style Code - How to Queue Jobs?
There is a code for generating critical css:
module.exports = function(gulp, plugins) {
return function () {
var critical = require('critical'),
settings = require("./settings.js"),
urls = settings.urls,
dimensions = settings.dimensions;
dimensions.forEach(function(dimension){
urls.forEach(function(entry){
critical.generate({
src: settings.base_url + entry.url,
dest: settings.dest_folder + dimension.prefix + entry.name + '.css',
minify: true,
ignore: ['.big-header-wrapper', 'header.small'],
width: dimension.width,
height: dimension.height
});
});
});
};
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question