From a1281092c4bc21190464e69a8546066f5cea491f Mon Sep 17 00:00:00 2001 From: Alex Dunphy Date: Fri, 20 Nov 2015 15:43:50 +0000 Subject: [PATCH] Add the .file property to options before handing off to node-sass: https://github.com/dlmanning/gulp-sass/pull/353 Changes from https://github.com/eoneill/gulp-sass --- index.js | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/index.js b/index.js index a614f527..4ecf6182 100644 --- a/index.js +++ b/index.js @@ -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;