0.0.4 • Published 8 years ago

babel-plugin-react-originjs v0.0.4

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

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

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago