Hoist current file name for transform-react-jsx-source
For better tooling support it's important to include absolute file name for JSX elements. However, having them inline will inflate resulting file size, so we move the file name to a constant declared at the beginning of the file and reference it from `__source` attribute.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
var __jsxFileName = "/I/am/not/sure/how/to/get/path/to/test/fixtures/react-source/basic-sample/actual.js";
|
||||
var x = <sometag __source={{
|
||||
fileName: "../test/fixtures/react-source/basic-sample/actual.js",
|
||||
fileName: __jsxFileName,
|
||||
lineNumber: 1
|
||||
}} />;
|
||||
}} />;
|
||||
|
||||
Reference in New Issue
Block a user