Skip to content

Commit

Permalink
Breaking: Avoid overwriting file or sourceRoot properties
Browse files Browse the repository at this point in the history
  • Loading branch information
phated committed Jun 17, 2017
1 parent c057703 commit f79c6d8
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 14 deletions.
6 changes: 0 additions & 6 deletions lib/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,12 +252,6 @@ function contentIncluded(file, state, callback) {

var sourceMapPath = path.join(file.base, mapFile);

// best effort, can be incorrect if options.destPath not set
state.sourceMap.file = normalizePath(path.relative(path.dirname(sourceMapPath), file.path));
if (state.sourceMap.sourceRoot === '' || (state.sourceMap.sourceRoot && state.sourceMap.sourceRoot[0] === '.')) {
state.sourceMap.sourceRoot = normalizePath(path.join(path.relative(path.dirname(sourceMapPath), file.base), state.sourceMap.sourceRoot));
}

// add new source map file to state
state.sourceMapFile = createSourceMapFile({
cwd: file.cwd,
Expand Down
8 changes: 0 additions & 8 deletions test/write.js
Original file line number Diff line number Diff line change
Expand Up @@ -264,12 +264,4 @@ describe('write', function() {
done(err);
});
});

it('should create shortest path to file in sourceMap#file', function(done) {
var file = makeNestedFile();
sourcemaps.write(file, 'dir1/maps', function(err, updatedFile) {
expect(updatedFile.sourceMap.file).toEqual('../../../dir2/helloworld.js');
done(err);
});
});
});

0 comments on commit f79c6d8

Please sign in to comment.