Skip to content
This repository was archived by the owner on Sep 19, 2025. It is now read-only.

Commit 90feb83

Browse files
authored
Merge pull request #49 from ChadKillingsworth/remove-contribution
Remove contribution
2 parents 3763bf3 + 6cc8e0d commit 90feb83

File tree

3 files changed

+6
-13
lines changed

3 files changed

+6
-13
lines changed

lib/gulp/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,11 @@ module.exports = function(initOptions) {
196196

197197
for (var i = 0; i < outputFiles.length; i++) {
198198
if (outputFiles[i].sourceMap) {
199+
if (outputFiles[i].sourceMap.sources) {
200+
outputFiles[i].sourceMap.sources = outputFiles[i].sourceMap.sources.map(function(sourcePath) {
201+
return path.isAbsolute(sourcePath[0]) ? sourcePath.substr(1) : sourcePath;
202+
});
203+
}
199204
applySourceMap(outputFiles[i], outputFiles[i].sourceMap);
200205
}
201206
this.push(outputFiles[i]);

lib/gulp/json-to-vinyl.js

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,7 @@ module.exports = function(input) {
4141
contents: new Buffer(fileList[i].src)
4242
});
4343
if (fileList[i].source_map) {
44-
45-
// Undo what concat-to-json.js did to the source map paths
46-
var sourceMap = JSON.parse(fileList[i].source_map);
47-
var sources = sourceMap.sources;
48-
for (var j = 0; j < sources.length; j++) {
49-
var source = sources[j];
50-
if (path.isAbsolute(source)) {
51-
sources[j] = path.relative('/', source);
52-
}
53-
}
54-
file.sourceMap = sourceMap;
44+
file.sourceMap = JSON.parse(fileList[i].source_map);
5545
}
5646
outputFiles.push(file);
5747
}

test/gulp.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ var sourcemaps = require('gulp-sourcemaps');
2929
var File = require('vinyl');
3030
var compilerPackage = require('../');
3131
var closureCompiler = compilerPackage.gulp();
32-
var fs = require('fs');
3332
require('mocha');
3433

3534
describe('gulp-google-closure-compiler', function() {
@@ -166,7 +165,6 @@ describe('gulp-google-closure-compiler', function() {
166165
.pipe(assert.length(1))
167166
.pipe(assert.first(function (f) {
168167
f.sourceMap.sources.should.have.length(2);
169-
f.sourceMap.sources.should.matchEach(fs.existsSync);
170168
f.sourceMap.file.should.eql('compiled.js');
171169
}))
172170
.pipe(assert.end(done));

0 commit comments

Comments
 (0)