Created
August 4, 2014 18:05
-
-
Save garystorey/3f7ea6e1010c62f083c4 to your computer and use it in GitHub Desktop.
Get critical styles via Gulp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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