$ npm install babel-plugin-remove-export-keywords
Babel plugin to remove all export statements. Used by MDX.
npm:
npm install babel-plugin-remove-export-keywords
yarn:
yarn add babel-plugin-remove-export-keywords
Say we have the following code in input.jsx:
export const Foo = () => (
<div>
<Button />
</div>
)
And our script, example.js:
const fs = require('fs')
const babel = require('@babel/core')
const removeExportKeywords = require('babel-plugin-remove-export-keywords')
const result = babel.transformSync(fs.readFileSync('./input.jsx'), {
configFile: false,
plugins: ['@babel/plugin-syntax-jsx', removeExportKeywords]
})
console.log(result.code)
Now, running node example yields:
const Foo = () => (
<div>
<Button />
</div>
)
removeExportKeywordsPlugin for Babel to remove export keywords.
MIT
© 2010 - cnpmjs.org x YWFE | Home | YWFE