1
0
mirror of https://github.com/kremalicious/blog.git synced 2024-11-26 11:49:04 +01:00

consolidate the css tasks with postcss

This commit is contained in:
Matthias Kretschmann 2015-05-31 20:13:27 +02:00
parent 474c3744e0
commit 805af1d236
2 changed files with 62 additions and 65 deletions

View File

@ -77,22 +77,20 @@ module.exports = function(grunt){
} }
}, },
// combine css media queries // Post process css
cmq: { postcss: {
production: { options: {
files: { processors: [
'<%= config.site %>/<%= config.assets.css %>/': ['<%= config.site %>/<%= config.assets.css %>/kremalicious3.min.css'] // autoprefixer
} require('autoprefixer-core')({browsers: 'last 2 versions'}),
} // combine media queries
}, require('css-mqpacker'),
// css minification
// minify css require('csswring')
cssmin: { ]
production: { },
files: { dist: {
'<%= config.site %>/<%= config.assets.css %>/kremalicious3.min.css': ['<%= config.site %>/<%= config.assets.css %>/*.css'], src: '<%= config.site %>/<%= config.assets.css %>/*.css'
'<%= config.site %>/<%= config.assets.css %>/poststyle-2300.min.css': ['<%= config.site %>/<%= config.assets.css %>/poststyle-2300.min.css']
}
} }
}, },
@ -168,7 +166,7 @@ module.exports = function(grunt){
}, },
stylus: { stylus: {
files: ['<%= config.src %>/<%= config.assets.stylus %>/*.styl'], files: ['<%= config.src %>/<%= config.assets.stylus %>/*.styl'],
tasks: ['stylus', 'cmq', 'cssmin'] tasks: ['stylus', 'postcss']
}, },
js: { js: {
files: ['<%= config.src %>/<%= config.assets.js %>/*.js'], files: ['<%= config.src %>/<%= config.assets.js %>/*.js'],
@ -185,7 +183,7 @@ module.exports = function(grunt){
'<%= config.src %>/_posts/**', '<%= config.src %>/_posts/**',
'<%= config.src %>/_drafts/**' '<%= config.src %>/_drafts/**'
], ],
tasks: ['jekyll:development', 'stylus', 'cmq', 'cssmin', 'uglify'] tasks: ['jekyll:development', 'stylus', 'postcss', 'uglify']
}, },
}, },
@ -294,8 +292,7 @@ module.exports = function(grunt){
// Default Task, assets only // Default Task, assets only
grunt.registerTask('default', [ grunt.registerTask('default', [
'stylus', 'stylus',
'cmq', 'postcss',
'cssmin',
'uglify', 'uglify',
'connect', 'connect',
'watch' 'watch'
@ -307,8 +304,7 @@ module.exports = function(grunt){
'jekyll:development', 'jekyll:development',
'rsync:copy_media', 'rsync:copy_media',
'stylus', 'stylus',
'cmq', 'postcss',
'cssmin',
'uglify', 'uglify',
'connect', 'connect',
'watch' 'watch'
@ -320,8 +316,7 @@ module.exports = function(grunt){
'jekyll:production', 'jekyll:production',
'rsync:copy_media', 'rsync:copy_media',
'stylus', 'stylus',
'cmq', 'postcss',
'cssmin',
'uglify', 'uglify',
'imagemin:assets', 'imagemin:assets',
'imagemin:touchicons', 'imagemin:touchicons',

View File

@ -1,43 +1,45 @@
{ {
"name": "kremalicious", "name": "kremalicious",
"author": "Matthias Kretschmann <m@kretschmann.io>", "author": "Matthias Kretschmann <m@kretschmann.io>",
"description": "Blog of Matthias Kretschmann", "description": "Blog of Matthias Kretschmann",
"version": "3.0.0", "version": "3.0.0",
"main": "Gruntfile.js", "main": "Gruntfile.js",
"scripts": { "scripts": {
"postinstall": "bower install && bundle install" "postinstall": "bower install && bundle install"
}, },
"dependencies": { "dependencies": {
"imagesloaded": ">=3.1.8", "imagesloaded": ">=3.1.8",
"jquery": ">=2.1.4", "jquery": ">=2.1.4",
"masonry-layout": ">=3.3.0", "masonry-layout": ">=3.3.0",
"normalize-css": ">=2.3.1", "normalize-css": ">=2.3.1",
"normalize-opentype.css": ">=0.2.4", "normalize-opentype.css": ">=0.2.4",
"picturefill": ">=2.3.1" "picturefill": ">=2.3.1"
}, },
"devDependencies": { "devDependencies": {
"grunt": ">=0.4.5", "autoprefixer-core": ">=5.2.0",
"grunt-combine-media-queries": ">=1.0.8", "css-mqpacker": ">=3.1.0",
"grunt-contrib-clean": ">=0.5.0", "csswring": ">=3.0.5",
"grunt-contrib-connect": ">=0.5.0", "grunt": ">=0.4.5",
"grunt-contrib-cssmin": ">=0.6.2", "grunt-contrib-clean": ">=0.5.0",
"grunt-contrib-imagemin": ">=0.7.0", "grunt-contrib-connect": ">=0.5.0",
"grunt-contrib-stylus": ">=0.18.0", "grunt-contrib-imagemin": ">=0.7.0",
"grunt-contrib-uglify": ">=0.2.2", "grunt-contrib-stylus": ">=0.18.0",
"grunt-contrib-watch": ">=0.5.3", "grunt-contrib-uglify": ">=0.2.2",
"grunt-jekyll": ">=0.4.0", "grunt-contrib-watch": ">=0.5.3",
"grunt-rev": ">=0.1.0", "grunt-postcss": ">=0.4.0",
"grunt-rsync": ">=0.2.1", "grunt-jekyll": ">=0.4.0",
"grunt-text-replace": ">=0.3.12", "grunt-rev": ">=0.1.0",
"grunt-usemin": ">=2.0.2", "grunt-rsync": ">=0.2.1",
"nib": ">=1.0.3", "grunt-text-replace": ">=0.3.12",
"stylus": ">=0.45.0" "grunt-usemin": ">=2.0.2",
}, "nib": ">=1.0.3",
"engines": { "stylus": ">=0.45.0"
"node": ">=0.10.29" },
}, "engines": {
"repository": { "node": ">=0.10.29"
"type": "git", },
"url": "git@github.com:kremalicious/kremalicious3.git" "repository": {
} "type": "git",
"url": "git@github.com:kremalicious/kremalicious3.git"
}
} }