From 00963bc41f2163e3c84d6c4a744d1e023ea8fd0c Mon Sep 17 00:00:00 2001 From: Joe Bruno Date: Tue, 1 Dec 2015 13:15:29 -0500 Subject: [PATCH] Fixed sourcemaps filename issue ('stdin') Fixed the issue where sourcemaps were not displaying the correct filename, but were instead displaying 'stdin' --- index.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index a614f52..bd254ce 100644 --- a/index.js +++ b/index.js @@ -90,7 +90,17 @@ var gulpSass = function gulpSass(options, sync) { } } // Replace the stdin with the original file name - sassMap.sources[sassMap.sources.indexOf(sassMapFile)] = sassFileSrc; + // sassMap.sources[sassMap.sources.indexOf(sassMapFile)] = sassFileSrc; + + // Commented out line 93 and added lines 95 - 103 + // Remove 'stdin' from souces and replace with filenames! + var srcs = sassMap.sources.filter(function(src) { + if (src.indexOf("stdin") === -1) { + return src; + } + }); + sassMap.sources = srcs; + sassMap.sources.unshift(sassFileSrc); // Replace the map file with the original file name (but new extension) sassMap.file = gutil.replaceExtension(sassFileSrc, '.css'); // Apply the map