From 94887d35e1036ab8e0a6ce402e2391bbb5c10c4d Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Wed, 18 Nov 2015 20:32:11 -0800 Subject: [PATCH] add babel-plugin-syntax-function-sent plugin --- .../.npmignore | 3 ++ .../README.md | 35 +++++++++++++++++++ .../package.json | 17 +++++++++ .../src/index.js | 7 ++++ 4 files changed, 62 insertions(+) create mode 100644 packages/babel-plugin-syntax-function-sent/.npmignore create mode 100644 packages/babel-plugin-syntax-function-sent/README.md create mode 100644 packages/babel-plugin-syntax-function-sent/package.json create mode 100644 packages/babel-plugin-syntax-function-sent/src/index.js diff --git a/packages/babel-plugin-syntax-function-sent/.npmignore b/packages/babel-plugin-syntax-function-sent/.npmignore new file mode 100644 index 0000000000..cace0d6ddc --- /dev/null +++ b/packages/babel-plugin-syntax-function-sent/.npmignore @@ -0,0 +1,3 @@ +node_modules +*.log +src diff --git a/packages/babel-plugin-syntax-function-sent/README.md b/packages/babel-plugin-syntax-function-sent/README.md new file mode 100644 index 0000000000..4493d7ccda --- /dev/null +++ b/packages/babel-plugin-syntax-function-sent/README.md @@ -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"] +}); +``` diff --git a/packages/babel-plugin-syntax-function-sent/package.json b/packages/babel-plugin-syntax-function-sent/package.json new file mode 100644 index 0000000000..c367034772 --- /dev/null +++ b/packages/babel-plugin-syntax-function-sent/package.json @@ -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" + } +} diff --git a/packages/babel-plugin-syntax-function-sent/src/index.js b/packages/babel-plugin-syntax-function-sent/src/index.js new file mode 100644 index 0000000000..b79f1e04fc --- /dev/null +++ b/packages/babel-plugin-syntax-function-sent/src/index.js @@ -0,0 +1,7 @@ +export default function () { + return { + manipulateOptions(opts, parserOpts) { + parserOpts.plugins.push("functionSent"); + } + }; +}