Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions lib/compass.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
var exec = require('child_process').exec;

var path = require('path');
/**
* express middleware for serving compiled on-the-fly sass/scss files.
*
* @type {Function}
*/
var compass = module.exports = function(options) {
return function(req, res, next) {
compass.compile(options, function() {
return next();
});
};
return function(req, res, next) {
if('.css' == path.extname(req.url)){
compass.compile(options, function() {
return next();
});
} else {
return next();
}
};
};

/**
Expand Down