babel-plugin-react-originjs

0.0.4 • Public • Published

babel-plugin-react-originjs

Make react-components into original js

npm version npm downloads

A babel plugin that make react-components into original js.

Before:

ReactDOM.render(<HelloWorld />, document.getElementById('wrap'))

After:

window['ICAT'] && window['ICAT'].react? ICAT.react(function(el){ ReactDOM.render(<HelloWorld />, el); }) : ReactDOM.render(<HelloWorld />, document.getElementById('wrap'));

Installation

$ npm install babel-plugin-react-originjs

Usage

Via .babelrc (Recommended)

.babelrc

{
  "plugins": ["react-originjs"]
}

Via CLI

$ babel --plugins react-originjs script.js

Via Node API

require('babel-core').transform('code', {
  plugins: ['react-originjs']
});

License

MIT

Dependencies (0)

    Dev Dependencies (4)

    Package Sidebar

    Install

    npm i babel-plugin-react-originjs

    Weekly Downloads

    1

    Version

    0.0.4

    License

    MIT

    Last publish

    Collaborators

    • valleykid