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:
Ben Alpert 2016-05-16 11:15:12 -07:00
parent 3703b63a11
commit 6afd51061a
1 changed files with 4 additions and 1 deletions

View File

@ -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;