add syntax plugins

This commit is contained in:
Sebastian McKenzie
2015-10-05 16:37:49 +01:00
parent f88cc9d509
commit 9113542b12
35 changed files with 451 additions and 7 deletions

View File

@@ -0,0 +1,3 @@
node_modules
*.log
src

View File

@@ -0,0 +1,35 @@
# babel-plugin-syntax-function-bind
Allow parsing of function bind.
## Installation
```sh
$ npm install babel-plugin-syntax-function-bind
```
## Usage
### Via `.babelrc` (Recommended)
**.babelrc**
```json
{
"plugins": ["syntax-function-bind"]
}
```
### Via CLI
```sh
$ babel --plugins syntax-function-bind script.js
```
### Via Node API
```javascript
require("babel-core").transform("code", {
plugins: ["syntax-function-bind"]
});
```

View File

@@ -0,0 +1,11 @@
{
"name": "babel-plugin-syntax-function-bind",
"version": "1.0.0",
"description": "Allow parsing of function bind",
"repository": "babel/babel",
"license": "MIT",
"main": "lib/index.js",
"keywords": [
"babel-plugin"
]
}

View File

@@ -0,0 +1,7 @@
export default function () {
return {
manipulateOptions(opts, parserOpts) {
parserOpts.plugins.push("functionBind");
}
};
}