You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Noan07 5fad98b9c5
pb npm
2 years ago
..
lib pb npm 2 years ago
.npmignore pb npm 2 years ago
README.md pb npm 2 years ago
package.json pb npm 2 years ago

README.md

babel-plugin-transform-react-jsx-source

Adds source file and line number to JSX elements.

Example

In

<sometag />

Out

<sometag __source={ { fileName: 'this/file.js', lineNumber: 10 } } />

Installation

npm install --save-dev babel-plugin-transform-react-jsx-source

Usage

.babelrc

{
  "plugins": ["transform-react-jsx-source"]
}

Via CLI

babel --plugins transform-react-jsx-source script.js

Via Node API

require("babel-core").transform("code", {
  plugins: ["transform-react-jsx-source"]
});