1 | # babel-plugin-transform-export-extensions
|
2 |
|
3 | > Compile additional export-from statements to ES2015
|
4 |
|
5 | ## Example
|
6 |
|
7 | ```js
|
8 | export * as ns from 'mod';
|
9 | export v from 'mod';
|
10 | ```
|
11 | [Try in REPL](http://babeljs.io/repl/#?evaluate=true&presets=es2015%2Cstage-0&code=export%20*%20as%20ns%20from%20'mod'%3B%0Aexport%20v%20from%20'mod'%3B)
|
12 |
|
13 | ## Installation
|
14 |
|
15 | ```sh
|
16 | npm install --save-dev babel-plugin-transform-export-extensions
|
17 | ```
|
18 |
|
19 | ## Usage
|
20 |
|
21 | ### Via `.babelrc` (Recommended)
|
22 |
|
23 | **.babelrc**
|
24 |
|
25 | ```json
|
26 | {
|
27 | "plugins": ["transform-export-extensions"]
|
28 | }
|
29 | ```
|
30 |
|
31 | ### Via CLI
|
32 |
|
33 | ```sh
|
34 | babel --plugins transform-export-extensions script.js
|
35 | ```
|
36 |
|
37 | ### Via Node API
|
38 |
|
39 | ```javascript
|
40 | require("babel-core").transform("code", {
|
41 | plugins: ["transform-export-extensions"]
|
42 | });
|
43 | ```
|
44 | ## References
|
45 |
|
46 | * ~~[Proposal: Additional export-from statements in ES7](https://github.com/leebyron/ecmascript-more-export-from)~~ (Withdrawn)
|
47 | * [ECMAScript Proposal: export ns from](https://github.com/leebyron/ecmascript-export-ns-from)
|
48 | * [ECMAScript Proposal: export default from](https://github.com/leebyron/ecmascript-export-default-from)
|