1 | # `babel-plugin-remove-export-keywords`
|
2 |
|
3 | Remove export keywords by coercing them into variable
|
4 | declarations. Used by [MDX](https://mdxjs.com).
|
5 |
|
6 | ## Installation
|
7 |
|
8 | ```sh
|
9 | yarn add babel-plugin-remove-export-keywords
|
10 | ```
|
11 |
|
12 | ## Usage
|
13 |
|
14 | ```js
|
15 | const babel = require('@babel/core')
|
16 |
|
17 | const plugin = require('babel-plugin-remove-export-keywords')
|
18 |
|
19 | const jsx = `
|
20 | export const Foo = () => (
|
21 | <div>
|
22 | <Button />
|
23 | </div>
|
24 | )
|
25 | `
|
26 |
|
27 | const plugin = new BabelPluginApplyMdxTypeProp()
|
28 |
|
29 | const result = babel.transform(jsx, {
|
30 | configFile: false,
|
31 | plugins: ['@babel/plugin-syntax-jsx', plugin]
|
32 | })
|
33 |
|
34 | console.log(result.code)
|
35 | ```
|
36 |
|
37 | ### Input
|
38 |
|
39 | ```js
|
40 | export const Foo = () => (
|
41 | <div>
|
42 | <Button />
|
43 | </div>
|
44 | )
|
45 | ```
|
46 |
|
47 | ### Output
|
48 |
|
49 | ```js
|
50 | const Foo = () => (
|
51 | <div>
|
52 | <Button mdxType="Button" />
|
53 | </div>
|
54 | )
|
55 | ```
|
56 |
|
57 | ## License
|
58 |
|
59 | MIT
|