Skip to content

Commit

Permalink
Adds consistent CSS minifying for #30
Browse files Browse the repository at this point in the history
  • Loading branch information
kennethormandy committed Aug 11, 2014
1 parent 03f5191 commit 17a1370
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
8 changes: 6 additions & 2 deletions lib/stylesheet/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ var path = require("path")
var fs = require("fs")
var helpers = require('../helpers')
var autoprefixer = require('autoprefixer')
var minify = require('minify')

/**
* Build Processor list for stylesheets.
Expand Down Expand Up @@ -56,8 +57,11 @@ module.exports = function(root, filePath, callback){
var render = processors[ext].compile(srcPath, dirs, data, function(err, css) {
if (err) return callback(err);

var prefixed = autoprefixer.process(css).css;
callback(null, prefixed);
/**
* Autoprefix, then consistently minify
*/
var post = minify.css(autoprefixer.process(css).css);
callback(null, post);
})

})
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
"marked": "0.2.9",
"less": "1.7.4",
"stylus": "0.47.3",
"autoprefixer": "~2.2.0"
"autoprefixer": "~2.2.0",
"minify": "git://github.com/ianstormtaylor/minify#0.1.1"
},
"devDependencies": {
"mocha": "1.8.2",
Expand Down

0 comments on commit 17a1370

Please sign in to comment.