Skip to content

Commit 35e2475

Browse files
committed
fix sourcemap filenames when using transformWithDetails. Fixes facebook#3140
1 parent 5126cee commit 35e2475

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

main.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ module.exports = {
2626
if (options && options.sourceMap) {
2727
result.sourceMap = output.sourceMap.toJSON();
2828
}
29+
if (options && options.sourceFilename) {
30+
result.sourceMap.sources = [options.sourceFilename];
31+
}
2932
return result;
3033
}
3134
};
@@ -46,6 +49,9 @@ function innerTransform(input, options) {
4649
}
4750

4851
var visitorList = visitors.getVisitorsBySet(visitorSets);
52+
if (options.sourceFilename) {
53+
options.filename = options.sourceFilename;
54+
}
4955
return transform(visitorList, input, options);
5056
}
5157

0 commit comments

Comments
 (0)