Skip to content

Commit f84fcaa

Browse files
committed
Breaking: Remove remote support in write method (closes #28)
1 parent bb21b56 commit f84fcaa

File tree

2 files changed

+5
-13
lines changed

2 files changed

+5
-13
lines changed

lib/helpers.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -158,11 +158,7 @@ function addSourceMaps(file, state, callback) {
158158

159159
nal.mapSeries(tasks, apply, done);
160160

161-
function done(err) {
162-
if (err) {
163-
return callback(err);
164-
}
165-
161+
function done() {
166162
callback(null, file);
167163
}
168164
}
@@ -232,9 +228,7 @@ function writeSourceMaps(file, destPath, callback) {
232228

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

235-
if (!isRemoteSource(sourcemapLocation)) {
236-
sourcemapLocation = normalizePath(sourcemapLocation);
237-
}
231+
sourcemapLocation = normalizePath(sourcemapLocation);
238232

239233
comment = convert.generateMapFileComment(sourcemapLocation, commentOpts);
240234
}

test/write.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -225,12 +225,10 @@ describe('write', function() {
225225
});
226226

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

0 commit comments

Comments
 (0)