A Babel plugin that strips import and export statements from modules.
npm install --save-dev babel-plugin-transform-es2015-modules-stripThe plugin takes this code:
import path from 'path';
console.log(path.sep);
export default 42;And returns this code:
console.log(path.sep);{
"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 plugin was used by Bootstrap between v4.0.0-beta (twbs/bootstrap#22045) and v4.1.2 (twbs/bootstrap#26767).
This project is licensed under the terms of the MIT license.