Merge branch '2-sourcemaps' of https://github.com/Keats/gulp-sass into 2.x

# By Vincent Prouillet
# Via Vincent Prouillet
* '2-sourcemaps' of https://github.com/Keats/gulp-sass:
  Sourcemap paths seem to be relative now?

# Conflicts:
#	index.js
This commit is contained in:
Sam Richard 2015-03-24 15:21:11 -04:00
commit 5f1812f623
2 changed files with 2 additions and 16 deletions

View file

@ -44,20 +44,7 @@ var gulpSass = function gulpSass(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;

View file

@ -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"
}