add babel-plugin-syntax-function-sent plugin
This commit is contained in:
parent
8fd543edae
commit
94887d35e1
3
packages/babel-plugin-syntax-function-sent/.npmignore
Normal file
3
packages/babel-plugin-syntax-function-sent/.npmignore
Normal file
@ -0,0 +1,3 @@
|
||||
node_modules
|
||||
*.log
|
||||
src
|
||||
35
packages/babel-plugin-syntax-function-sent/README.md
Normal file
35
packages/babel-plugin-syntax-function-sent/README.md
Normal file
@ -0,0 +1,35 @@
|
||||
# babel-plugin-syntax-function-sent
|
||||
|
||||
Allow parsing of the `function.sent` meta property.
|
||||
|
||||
## Installation
|
||||
|
||||
```sh
|
||||
$ npm install babel-plugin-syntax-function-sent
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
### Via `.babelrc` (Recommended)
|
||||
|
||||
**.babelrc**
|
||||
|
||||
```json
|
||||
{
|
||||
"plugins": ["syntax-function-sent"]
|
||||
}
|
||||
```
|
||||
|
||||
### Via CLI
|
||||
|
||||
```sh
|
||||
$ babel --plugins syntax-function-sent script.js
|
||||
```
|
||||
|
||||
### Via Node API
|
||||
|
||||
```javascript
|
||||
require("babel-core").transform("code", {
|
||||
plugins: ["syntax-function-sent"]
|
||||
});
|
||||
```
|
||||
17
packages/babel-plugin-syntax-function-sent/package.json
Normal file
17
packages/babel-plugin-syntax-function-sent/package.json
Normal file
@ -0,0 +1,17 @@
|
||||
{
|
||||
"name": "babel-plugin-syntax-function-sent",
|
||||
"version": "6.1.18",
|
||||
"description": "Allow parsing of the function.sent meta property",
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-function-sent",
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"keywords": [
|
||||
"babel-plugin"
|
||||
],
|
||||
"dependencies": {
|
||||
"babel-runtime": "^5.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel-helper-plugin-test-runner": "^6.1.18"
|
||||
}
|
||||
}
|
||||
7
packages/babel-plugin-syntax-function-sent/src/index.js
Normal file
7
packages/babel-plugin-syntax-function-sent/src/index.js
Normal file
@ -0,0 +1,7 @@
|
||||
export default function () {
|
||||
return {
|
||||
manipulateOptions(opts, parserOpts) {
|
||||
parserOpts.plugins.push("functionSent");
|
||||
}
|
||||
};
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user