babel-plugin-export-toplevel
v1.0.0
Published
A babel plugin that automatically exports all top-level names
Readme
babel-plugin-export-toplevel
A simple transform to automatically export all top-level names.
This is mostly useful for testing purposes, so you can have access to these names in testing while not exporting them in other environments.
Effect
Transforms
const hiddenFunction = () => {};
const publicFunction = () => {};
export default publicFunction;to something akin to
const hiddenFunction = () => {};
const publicFunction = () => {};
export default publicFunction;
export { publicFunction, hiddenFunction };Install
npm i --save-dev babel-plugin-export-toplevelUsage
.babelrc
{
"plugins": ["export-toplevel"]
}