Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

babel-plugin-react-originjs

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-react-originjs - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

5

package.json
{
"name": "babel-plugin-react-originjs",
"version": "0.0.3",
"version": "0.0.4",
"description": "Make react-components into original js",
"main": "lib/index.js",
"scripts": {
"build": "rm -rf lib && ./node_modules/.bin/babel src --out-dir lib --presets es2015",
"test": "echo \"Error: no test specified\" && exit 1"
"build": "rm -rf lib && ./node_modules/.bin/babel src --out-dir lib --presets es2015"
},

@@ -10,0 +9,0 @@ "repository": {

# babel-plugin-react-originjs
Make react-components into original js
[![npm version](https://img.shields.io/npm/v/babel-plugin-react-originjs.svg)](https://www.npmjs.org/package/babel-plugin-react-originjs)
[![npm downloads](https://img.shields.io/npm/dm/babel-plugin-react-originjs.svg)](https://www.npmjs.org/package/babel-plugin-react-originjs)
A babel plugin that make react-components into original js.
Before:
```js
ReactDOM.render(<HelloWorld />, document.getElementById('wrap'))
```
After:
```js
window['ICAT'] && window['ICAT'].react? ICAT.react(function(el){ ReactDOM.render(<HelloWorld />, el); }) : ReactDOM.render(<HelloWorld />, document.getElementById('wrap'));
```
## Installation
```sh
$ npm install babel-plugin-react-originjs
```
## Usage
### Via `.babelrc` (Recommended)
**.babelrc**
```json
{
"plugins": ["react-originjs"]
}
```
### Via CLI
```sh
$ babel --plugins react-originjs script.js
```
### Via Node API
```js
require('babel-core').transform('code', {
plugins: ['react-originjs']
});
```
## License
MIT
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc