Skip to content

Commit

Permalink
Add the .file property to options before handing off to node-sass: dl…
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdunphy committed Nov 20, 2015
1 parent 5787925 commit a128109
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,23 +37,14 @@ var gulpSass = function gulpSass(options, sync) {
opts = assign({}, options);
opts.data = file.contents.toString();

// We set the file path here so that libsass can correctly resolve import paths
opts.file = file.path;

// Ensure `indentedSyntax` is true if a `.sass` file
if (path.extname(file.path) === '.sass') {
opts.indentedSyntax = true;
}

// Ensure file's parent directory in the include path
if (opts.includePaths) {
if (typeof opts.includePaths === 'string') {
opts.includePaths = [opts.includePaths];
}
}
else {
opts.includePaths = [];
}

opts.includePaths.unshift(path.dirname(file.path));

// Generate Source Maps if plugin source-map present
if (file.sourceMap) {
opts.sourceMap = file.path;
Expand Down

0 comments on commit a128109

Please sign in to comment.