From 212e221212dfeb02efdf8dc4f25b3a604072bb2f Mon Sep 17 00:00:00 2001 From: Vincent Prouillet Date: Tue, 24 Mar 2015 12:15:21 +0000 Subject: [PATCH] Sourcemap paths seem to be relative now? At least the test still pass and paths looks the same with and without the relative fudge. Sourcemaps are completely wonky though and do not point at the right thing Also removes jshint since it's using eslint now --- index.js | 16 +--------------- package.json | 3 +-- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/index.js b/index.js index 5e6c871..6cf4b8a 100644 --- a/index.js +++ b/index.js @@ -40,23 +40,9 @@ module.exports = function(options) { )); } - // Build Source Maps! if (obj.map) { - // 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. - obj.map = JSON.parse(obj.map.toString()); - - if (obj.map.sources) { - obj.map.sources = obj.map.sources.map(function(source) { - var abs = path.resolve(path.dirname(file.path), source); - return path.relative(file.base, abs); - }); - - obj.map = JSON.stringify(obj.map); - applySourceMap(file, obj.map); + applySourceMap(file, JSON.parse(obj.map.toString())); } - } file.contents = obj.css; file.path = gutil.replaceExtension(file.path, '.css'); diff --git a/package.json b/package.json index 53139c9..47e6338 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "Gulp plugin for sass", "main": "index.js", "scripts": { - "test": "./node_modules/.bin/jshint index.js && ./node_modules/.bin/mocha test" + "test": "./node_modules/.bin/mocha test" }, "repository": { "type": "git", @@ -29,7 +29,6 @@ }, "devDependencies": { "eslint": "^0.17.1", - "jshint": "^2.6.3", "mocha": "^2.2.1", "should": "^5.2.0" }