Skip to content

Instantly share code, notes, and snippets.

@shidhincr
Forked from garystorey/getcriticalstyles.js
Last active August 29, 2015 14:07
Show Gist options
  • Save shidhincr/b7877775f061cfdcce7d to your computer and use it in GitHub Desktop.
Save shidhincr/b7877775f061cfdcce7d to your computer and use it in GitHub Desktop.
var penthouse = require('penthouse');
var Promise = require("bluebird");
var penthouseAsync = Promise.promisify(penthouse);
gulp.task('critical', function(){
penthouseAsync({
url : 'http://daverupert.com/',
css : './stylesheets/style.css',
height: 480
}).then( function (criticalCSS){
require('fs').writeFile('_includes/critical.css', criticalCSS );
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment