1
0
Fork 0

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

View File

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