mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Merge pull request #3164 from oiva/master
Fix sourcemap filenames when using transformWithDetails. Fixes #3140
This commit is contained in:
@@ -26,6 +26,9 @@ module.exports = {
|
||||
if (options && options.sourceMap) {
|
||||
result.sourceMap = output.sourceMap.toJSON();
|
||||
}
|
||||
if (options && options.sourceFilename) {
|
||||
result.sourceMap.sources = [options.sourceFilename];
|
||||
}
|
||||
return result;
|
||||
}
|
||||
};
|
||||
@@ -46,6 +49,9 @@ function innerTransform(input, options) {
|
||||
}
|
||||
|
||||
var visitorList = visitors.getVisitorsBySet(visitorSets);
|
||||
if (options.sourceFilename) {
|
||||
options.filename = options.sourceFilename;
|
||||
}
|
||||
return transform(visitorList, input, options);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user