Skip to content

Commit

Permalink
Breaking: Remove mapSources option (ref #19)
Browse files Browse the repository at this point in the history
  • Loading branch information
phated committed Jun 17, 2017
1 parent f2b07cc commit 7745b7d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 20 deletions.
10 changes: 2 additions & 8 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,8 @@ function write(file, options, callback) {
// fix paths if Windows style paths
sourceMap.file = helpers.unixStylePath(file.relative);

// TODO: Need a way to handle resolve this before passing in
// This module shouldn't be taking function options because they are normalized higher
if (options.mapSources && typeof options.mapSources === 'function') {
sourceMap.sources = sourceMap.sources.map(function(filePath) {
return options.mapSources(filePath);
});
}

// TODO: should we be normalizing at all?
// An end-user can use @gulp-sourcemaps/map-sources if they need normalization
sourceMap.sources = sourceMap.sources.map(function(filePath) {
return helpers.unixStylePath(filePath);
});
Expand Down
12 changes: 0 additions & 12 deletions test/write.js
Original file line number Diff line number Diff line change
Expand Up @@ -450,18 +450,6 @@ describe('write', function() {
});
});

it('should allow to change sources', function(done) {
var file = makeFile();
sourcemaps.write(file, {
mapSources: function(sourcePath) {
return '../src/' + sourcePath;
}
}, function(err, updatedFile) {
expect(updatedFile.sourceMap.sources).toEqual(['../src/helloworld.js']);
done(err);
});
});

it('should create shortest path to file in sourceMap#file', function(done) {
var file = makeNestedFile();
sourcemaps.write(file, { path: 'dir1/maps' }, function(err, updatedFile) {
Expand Down

0 comments on commit 7745b7d

Please sign in to comment.