babel-plugin-remove-export-keywords

1.6.22 • Public • Published

babel-plugin-remove-export-keywords

Remove export keywords by coercing them into variable declarations. Used by MDX.

Installation

yarn add babel-plugin-remove-export-keywords

Usage

const babel = require('@babel/core')

const plugin = require('babel-plugin-remove-export-keywords')

const jsx = `
export const Foo = () => (
  <div>
    <Button />
  </div>
)
`

const plugin = new BabelPluginApplyMdxTypeProp()

const result = babel.transform(jsx, {
  configFile: false,
  plugins: ['@babel/plugin-syntax-jsx', plugin]
})

console.log(result.code)

Input

export const Foo = () => (
  <div>
    <Button />
  </div>
)

Output

const Foo = () => (
  <div>
    <Button mdxType="Button" />
  </div>
)

License

MIT

Package Sidebar

Install

npm i babel-plugin-remove-export-keywords

Homepage

mdxjs.com

Weekly Downloads

3,328

Version

1.6.22

License

MIT

Unpacked Size

2.88 kB

Total Files

4

Last publish

Collaborators

  • remcohaszing
  • johno
  • timneutkens
  • wooorm