This is a Babel plugin which strips import and export statements from modules.
In
import path from 'path';
console.log(path.sep);
export default 42;
Out
console.log(path.sep);
npm install --save-dev babel-plugin-transform-es2015-modules-strip
{
"presets": [
["@babel/env", {
"modules": false
}]
],
"plugins": ["transform-es2015-modules-strip"]
}
require("@babel/core").transformSync("code", {
presets: [
["@babel/env", {
"modules": false
}]
],
plugins: ["transform-es2015-modules-strip"]
});
This project is licensed under the terms of the MIT license.