This plugin allows Babel to remove export directives, declaration will remain.
In
export function fname() {
}
Out
function fname() {
}
npm install --save-dev babel-plugin-unexport
.babelrc
{
"plugins": ["unexport"]
}
babel --plugins unexport script.js
require("babel-core").transform("code", {
plugins: ["unexport"]
});