Skip to content

Commit

Permalink
Embed JSX filename paths relative to repo root (#6778)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sophiebits committed May 16, 2016
1 parent 3703b63 commit 6afd510
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion scripts/jest/preprocessor.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 6afd510

Please sign in to comment.