Split exportExtensions into exportDefault and exportNamespace plugins… (#6920)

* Split exportExtensions into two plugins in babylon
* rename proposal-export-default to proposal-export-default-from
* rename proposal-export-namespace to proposal-export-namespace-from
This commit is contained in:
Brian Ng
2017-11-30 16:46:36 -06:00
committed by Henry Zhu
parent 9d9710c765
commit d8bbaaae0a
86 changed files with 226 additions and 348 deletions

View File

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

View File

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

View File

@@ -0,0 +1,17 @@
{
"name": "@babel/plugin-syntax-export-namespace-from",
"version": "7.0.0-beta.32",
"description": "Allow parsing of export namespace from",
"repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-export-namespace-from",
"license": "MIT",
"main": "lib/index.js",
"keywords": [
"babel-plugin"
],
"peerDependencies": {
"@babel/core": "7.0.0-beta.32"
},
"devDependencies": {
"@babel/core": "7.0.0-beta.32"
}
}

View File

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