0.0.4 • Published 10 years ago
babel-plugin-react-originjs v0.0.4
babel-plugin-react-originjs
Make react-components into original js
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-originjsUsage
Via .babelrc (Recommended)
.babelrc
{
"plugins": ["react-originjs"]
}Via CLI
$ babel --plugins react-originjs script.jsVia Node API
require('babel-core').transform('code', {
plugins: ['react-originjs']
});License
MIT