Skip to content

Commit

Permalink
Merge pull request #5 from mkoryak/master
Browse files Browse the repository at this point in the history
make opts be passed through to node-sass.
  • Loading branch information
dgbeck committed Jul 20, 2015
2 parents c0f0ddf + 8141c63 commit b1f59d3
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ var sass = require( "node-sass" );
var path = require( "path" );

module.exports = function( file, opts ) {
opts = opts || {};
var includePaths = opts.includePaths;
delete opts.includePaths;

var data = "";
if( file !== undefined && path.extname( file ) !== ".scss" )
return through();
Expand All @@ -16,13 +20,13 @@ module.exports = function( file, opts ) {

function end() {
try {
var sassOpts = {};
var sassOpts = opts;

sassOpts.data = data;

var pathToAdd = [ path.dirname( file ) ];
sassOpts.includePaths = Array.isArray( opts && opts.includePaths ) ?
opts.includePaths.concat( pathToAdd ) :
sassOpts.includePaths = Array.isArray( includePaths ) ?
includePaths.concat( pathToAdd ) :
pathToAdd;

var result = sass.renderSync( sassOpts );
Expand Down

0 comments on commit b1f59d3

Please sign in to comment.