Embed JSX filename paths relative to repo root (#6778)
Test Plan: Changed the preprocessor to log the output of babel.transform and saw ``` var _jsxFileName = 'src/isomorphic/modern/element/__tests__/ReactJSXElementValidator-test.js'; ``` in the resulting output, instead of an absolute path.
This commit is contained in:
parent
3703b63a11
commit
6afd51061a
|
@ -54,7 +54,10 @@ module.exports = {
|
|||
) {
|
||||
return babel.transform(
|
||||
src,
|
||||
Object.assign({filename: filePath}, babelOptions)
|
||||
Object.assign(
|
||||
{filename: path.relative(process.cwd(), filePath)},
|
||||
babelOptions
|
||||
)
|
||||
).code;
|
||||
}
|
||||
return src;
|
||||
|
|
Loading…
Reference in New Issue