start moving more transformers to packages and finish import of plugins from babel-plugins
This commit is contained in:
3
packages/babel-plugin-react-inline-elements/.gitignore
vendored
Normal file
3
packages/babel-plugin-react-inline-elements/.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
node_modules
|
||||
*.log
|
||||
lib
|
||||
3
packages/babel-plugin-react-inline-elements/.npmignore
Normal file
3
packages/babel-plugin-react-inline-elements/.npmignore
Normal file
@@ -0,0 +1,3 @@
|
||||
node_modules
|
||||
*.log
|
||||
src
|
||||
35
packages/babel-plugin-react-inline-elements/README.md
Normal file
35
packages/babel-plugin-react-inline-elements/README.md
Normal file
@@ -0,0 +1,35 @@
|
||||
# babel-plugin-react-inline-elements
|
||||
|
||||
Turn JSX elements into exploded React objects
|
||||
|
||||
## Installation
|
||||
|
||||
```sh
|
||||
$ npm install babel-plugin-react-inline-elements
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
### Via `.babelrc` (Recommended)
|
||||
|
||||
**.babelrc**
|
||||
|
||||
```json
|
||||
{
|
||||
"plugins": ["react-inline-elements"]
|
||||
}
|
||||
```
|
||||
|
||||
### Via CLI
|
||||
|
||||
```sh
|
||||
$ babel --plugins react-inline-elements script.js
|
||||
```
|
||||
|
||||
### Via Node API
|
||||
|
||||
```javascript
|
||||
require("babel-core").transform("code", {
|
||||
plugins: ["react-inline-elements"]
|
||||
});
|
||||
```
|
||||
11
packages/babel-plugin-react-inline-elements/package.json
Normal file
11
packages/babel-plugin-react-inline-elements/package.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"name": "babel-plugin-react-inline-elements",
|
||||
"version": "1.0.0",
|
||||
"description": "Turn JSX elements into exploded React objects",
|
||||
"repository": "babel/babel",
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"keywords": [
|
||||
"babel-plugin"
|
||||
]
|
||||
}
|
||||
7
packages/babel-plugin-react-inline-elements/src/index.js
Normal file
7
packages/babel-plugin-react-inline-elements/src/index.js
Normal file
@@ -0,0 +1,7 @@
|
||||
export default function ({ types: t }) {
|
||||
return {
|
||||
visitor: {
|
||||
// your visitor methods go here
|
||||
}
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user