@babel/plugin-transform-react-jsx-source

Example

In

  1. <sometag />

Out

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

Installation

  1. npm install --save-dev @babel/plugin-transform-react-jsx-source

Usage

  1. {
  2. "plugins": ["@babel/plugin-transform-react-jsx-source"]
  3. }

Via CLI

  1. babel --plugins @babel/plugin-transform-react-jsx-source script.js

Via Node API

  1. require("@babel/core").transform("code", {
  2. plugins: ["@babel/plugin-transform-react-jsx-source"]
  3. });