babel-plugin-react-originjs
Advanced tools
Comparing version 0.0.3 to 0.0.4
{ | ||
"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 |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
8018
1
56