From 480820b93714898fc8583d8ba52c07d5ce025cf7 Mon Sep 17 00:00:00 2001 From: Sam Richard Date: Tue, 24 Mar 2015 04:51:57 -0500 Subject: [PATCH] omitSourceMapUrl instead of hack Node Sass now returns a buffer, so we don't need to turn it into a buffer for the contents --- index.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index 86addb6..73058aa 100644 --- a/index.js +++ b/index.js @@ -25,6 +25,7 @@ module.exports = function(options) { // Generate Source Maps if plugin source-map present if (file.sourceMap) { opts.sourceMap = file.path; + opts.omitSourceMapUrl = true; } var callback = function(error, obj) { @@ -36,9 +37,6 @@ module.exports = function(options) { // Build Source Maps! if (obj.map) { - // hack to remove the already added sourceMappingURL from libsass - obj.css = obj.css.toString().replace(/\/\*#\s*sourceMappingURL\=.*\*\//, ''); - // libsass gives us sources' paths relative to file; // gulp-sourcemaps needs sources' paths relative to file.base; // so alter the sources' paths to please gulp-sourcemaps. @@ -55,7 +53,7 @@ module.exports = function(options) { } } - file.contents = new Buffer(obj.css); + file.contents = obj.css; file.path = gutil.replaceExtension(file.path, '.css'); cb(null, file);