UNPKG

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