Skip to content

Commit

Permalink
Breaking: Remove remote support in write method (closes #28)
Browse files Browse the repository at this point in the history
  • Loading branch information
phated committed Jun 17, 2017
1 parent 123d5c4 commit eefa0f1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
10 changes: 2 additions & 8 deletions lib/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,7 @@ function addSourceMaps(file, state, callback) {

nal.mapSeries(tasks, apply, done);

function done(err) {
if (err) {
return callback(err);
}

function done() {
callback(null, file);
}
}
Expand Down Expand Up @@ -232,9 +228,7 @@ function writeSourceMaps(file, destPath, callback) {

var sourcemapLocation = path.relative(file.dirname, sourceMapPath);

if (!isRemoteSource(sourcemapLocation)) {
sourcemapLocation = normalizePath(sourcemapLocation);
}
sourcemapLocation = normalizePath(sourcemapLocation);

comment = convert.generateMapFileComment(sourcemapLocation, commentOpts);
}
Expand Down
8 changes: 3 additions & 5 deletions test/write.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,12 +225,10 @@ describe('write', function() {
});

// TODO: need to figure out this test
it.skip('does not normalize remote paths', function(done) {
it.skip('properly handles remote paths', function(done) {
var file = makeNestedFile();
file.path = file.path.replace(/\//g, '\\\\');
console.log(file.path);
sourcemaps.write(file, '..\\\\maps', function(err, updatedFile) {
expect(updatedFile.contents).toEqual(sourceContent + '//# sourceMappingURL=../maps/helloworld.js.map\n');
sourcemaps.write(file, 'http://example.com', function(err, updatedFile) {
expect(updatedFile.contents).toEqual(sourceContent + '//# sourceMappingURL=http://example.com/dir1/dir2/helloworld.js.map\n');
done(err);
});
});
Expand Down

0 comments on commit eefa0f1

Please sign in to comment.