babel-plugin-transform-react-jsx-source-to-style

0.0.2 • Public • Published

babel-plugin-transform-react-jsx-source-to-style

npm

Add style['--source-code-location'] to all JSX Elements.

English | 简体中文

Example

In

<sometag />

Out

<sometag style={{'--source-code-location': `${__jsxFileName}:${lineNumber}:${columnNumber}`}} />

Install

Using npm:

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

or using yarn:

yarn add babel-plugin-transform-react-jsx-source-to-style --dev

Usage

With a configuration file (Recommended)

{
  "plugins": ["babel-plugin-transform-react-jsx-source-to-style"]
}

Via CLI

babel --plugins babel-plugin-transform-react-jsx-source-to-style script.js

Via Node API

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

Readme

Keywords

Package Sidebar

Install

npm i babel-plugin-transform-react-jsx-source-to-style

Weekly Downloads

0

Version

0.0.2

License

MIT

Unpacked Size

16.7 kB

Total Files

20

Last publish

Collaborators

  • zjffun