Skip to content

Commit ad45d89

Browse files
committed
Add directory path to sourcemap entries, fixes #10
1 parent c7e504d commit ad45d89

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,14 @@ function typescriptLoader(text) {
3636
this._compiler.typeScriptWebpackHost.emit(resolver, filename, text)
3737
.then(function(output) {
3838
var result = findResultFor(output, filename);
39+
var sourceFilename = loaderUtils.getRemainingRequest(this);
40+
var current = loaderUtils.getCurrentRequest(this);
3941
if (result.text === undefined) {
4042
throw new Error('no output found for ' + filename);
4143
}
4244
var sourceMap = JSON.parse(result.sourceMap);
45+
sourceMap.sources = [sourceFilename];
46+
sourceMap.file = current;
4347
sourceMap.sourcesContent = [text];
4448
cb(null, result.text, sourceMap);
4549
}.bind(this))

0 commit comments

Comments
 (0)