1
0
mirror of https://github.com/kremalicious/blog.git synced 2024-11-29 23:48:11 +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
require('csswring')
]
}, },
dist: {
// minify css src: '<%= config.site %>/<%= config.assets.css %>/*.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']
}
} }
}, },
@ -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

@ -16,15 +16,17 @@
"picturefill": ">=2.3.1" "picturefill": ">=2.3.1"
}, },
"devDependencies": { "devDependencies": {
"autoprefixer-core": ">=5.2.0",
"css-mqpacker": ">=3.1.0",
"csswring": ">=3.0.5",
"grunt": ">=0.4.5", "grunt": ">=0.4.5",
"grunt-combine-media-queries": ">=1.0.8",
"grunt-contrib-clean": ">=0.5.0", "grunt-contrib-clean": ">=0.5.0",
"grunt-contrib-connect": ">=0.5.0", "grunt-contrib-connect": ">=0.5.0",
"grunt-contrib-cssmin": ">=0.6.2",
"grunt-contrib-imagemin": ">=0.7.0", "grunt-contrib-imagemin": ">=0.7.0",
"grunt-contrib-stylus": ">=0.18.0", "grunt-contrib-stylus": ">=0.18.0",
"grunt-contrib-uglify": ">=0.2.2", "grunt-contrib-uglify": ">=0.2.2",
"grunt-contrib-watch": ">=0.5.3", "grunt-contrib-watch": ">=0.5.3",
"grunt-postcss": ">=0.4.0",
"grunt-jekyll": ">=0.4.0", "grunt-jekyll": ">=0.4.0",
"grunt-rev": ">=0.1.0", "grunt-rev": ">=0.1.0",
"grunt-rsync": ">=0.2.1", "grunt-rsync": ">=0.2.1",