Adds source file, line number and column number to JSX elements.
In
<sometag>foo</sometag>
Out
<sometag
__source={{
fileName: '/Users/me/proj/src/thisFile.tsx',
lineNumber: 20,
columnNumber: 11,
}}
>
foo
</sometag>
yarn add -D ts-transform-jsx-source
import tsTranformJsxSource from 'ts-transform-jsx-source';
// ...
{
loader: "awesome-typescript-loader",
options: {
getCustomTransformers: () => ({ before: [tsTranformJsxSource] })
}
}
// ...
import tsTranformJsxSource from 'ts-transform-jsx-source';
const fuse = FuseBox.init({
homeDir: 'src/',
target: 'browser@es6',
output: 'dist/$name.js',
transformers: {
before: [tsTranformJsxSource],
},
});