Commit b5b96bfa by Chris Leishman

Pass options to render from middleware

Always include the directory of the scss file as the first path in include_paths
parent 3ec82e67
...@@ -74,7 +74,8 @@ module.exports = function(options){ ...@@ -74,7 +74,8 @@ module.exports = function(options){
var path = url.parse(req.url).pathname; var path = url.parse(req.url).pathname;
if (/\.css$/.test(path)) { if (/\.css$/.test(path)) {
var cssPath = join(dest, path) var cssPath = join(dest, path)
, sassPath = join(src, path.replace('.css', '.scss')); , sassPath = join(src, path.replace('.css', '.scss'))
, sassDir = dirname(sassPath)
if (debug) { if (debug) {
log('source', sassPath); log('source', sassPath);
...@@ -107,6 +108,9 @@ module.exports = function(options){ ...@@ -107,6 +108,9 @@ module.exports = function(options){
if (err) return error(err); if (err) return error(err);
fs.writeFile(cssPath, css, 'utf8', next); fs.writeFile(cssPath, css, 'utf8', next);
}); });
}, {
include_paths: [ sassDir ].concat(options.include_paths || []),
output_style: options.output_style
}); });
}); });
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment