switch to use vinyl-sourcemaps-apply
This commit is contained in:
parent
4c3154aeb1
commit
f3db14303a
5
index.js
5
index.js
|
@ -4,6 +4,7 @@ var fs = require('fs')
|
|||
, path = require('path')
|
||||
, gutil = require('gulp-util')
|
||||
, ext = gutil.replaceExtension
|
||||
, applySourceMap = require('vinyl-sourcemaps-apply')
|
||||
;
|
||||
|
||||
module.exports = function (options) {
|
||||
|
@ -44,11 +45,11 @@ module.exports = function (options) {
|
|||
var sourceMap;
|
||||
if (typeof opts.onSuccess === 'function') opts.onSuccess(css, map);
|
||||
|
||||
if (map && file.applySourceMap) {
|
||||
if (map) {
|
||||
// hack to remove the already added sourceMappingURL from libsass
|
||||
css = css.replace(/\n\/\*#\s*sourceMappingURL\=.*\*\//, '');
|
||||
|
||||
file.applySourceMap(map);
|
||||
applySourceMap(file, map);
|
||||
}
|
||||
|
||||
file.path = ext(file.path, '.css');
|
||||
|
|
|
@ -23,7 +23,8 @@
|
|||
"dependencies": {
|
||||
"node-sass": "~0.8",
|
||||
"gulp-util": "~2.2",
|
||||
"map-stream": "~0.1"
|
||||
"map-stream": "~0.1",
|
||||
"vinyl-sourcemaps-apply": "~0.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"tape": "~2.3",
|
||||
|
|
Loading…
Reference in a new issue