Commit 973dbece by Kevin Van Ransbeeck

Critical CSS

1 parent d8568a42
...@@ -90,6 +90,19 @@ module.exports = function(grunt) { ...@@ -90,6 +90,19 @@ module.exports = function(grunt) {
} }
}, },
criticalcss: {
custom_options: {
options: {
url: "http://kevin.demo/cssoptim/index.php",
width: 800,
height: 600,
outputfile: "css/critical.css",
filename: "css/style.min.css",
buffer: 800*1024
}
}
},
/** /**
* X :: Watch files for changes and act on them (recompile etc...). * X :: Watch files for changes and act on them (recompile etc...).
*/ */
...@@ -123,6 +136,6 @@ module.exports = function(grunt) { ...@@ -123,6 +136,6 @@ module.exports = function(grunt) {
// Load necessairy grunt tasks based on npm modules. // Load necessairy grunt tasks based on npm modules.
require("load-grunt-tasks")(grunt); require("load-grunt-tasks")(grunt);
grunt.registerTask('build', ['uglify', 'sass', 'concat_css', 'autoprefixer', 'cssmin', 'svgstore']); grunt.registerTask('build', ['uglify', 'sass', 'concat_css', 'autoprefixer', 'cssmin', 'svgstore', 'criticalcss']);
grunt.registerTask('default', ['build','watch']); grunt.registerTask('default', ['build','watch']);
} }
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
"grunt-contrib-cssmin": "^0.10.0", "grunt-contrib-cssmin": "^0.10.0",
"grunt-contrib-uglify": "^0.6.0", "grunt-contrib-uglify": "^0.6.0",
"grunt-contrib-watch": "~0.5.3", "grunt-contrib-watch": "~0.5.3",
"grunt-criticalcss": "^0.4.1",
"grunt-sass": "~0.8.1", "grunt-sass": "~0.8.1",
"grunt-svgstore": "^0.3.5", "grunt-svgstore": "^0.3.5",
"load-grunt-tasks": "^0.6.0", "load-grunt-tasks": "^0.6.0",
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!