fourword.fourkitchens.com/article/use-gulp-automat...var critical = require('critical');
gulp.task('critical', function (cb) {
critical.generate({
base: '_site/',
src: 'index.html',
css: ['css/all.min.css'],
dimensions: [{
width: 320,
height: 480
},{
width: 768,
height: 1024
},{
width: 1280,
height: 960
}],
dest: '../_includes/critical.css',
minify: true,
extract: false,
ignore: ['font-face']
});
});
И альтернатива
https://github.com/ben-eb/gulp-uncssvar gulp = require('gulp');
var uncss = require('gulp-uncss');
gulp.task('default', function() {
gulp.src('site.css')
.pipe(uncss({
html: ['index.html', 'about.html']
}))
.pipe(gulp.dest('./out'));
});