Skip to content

bardiharborow/babel-plugin-transform-es2015-modules-strip

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

babel-plugin-transform-es2015-modules-strip

This project has a package hosted on the NPM repository. This project is licensed under the terms of the MIT license.

A Babel plugin that strips import and export statements from modules.

Installation

npm install --save-dev babel-plugin-transform-es2015-modules-strip

Example

The plugin takes this code:

import path from 'path';

console.log(path.sep);

export default 42;

And returns this code:

console.log(path.sep);

Usage

In the babel.config.json configuration file

{
  "presets": [
    ["@babel/env", {
      "modules": false
    }]
  ],
  "plugins": ["transform-es2015-modules-strip"]
}

With the Node API

require("@babel/core").transformSync("code", {
  presets: [
    ["@babel/env", {
      "modules": false
    }]
  ],
  plugins: ["transform-es2015-modules-strip"]
});

History

This plugin was used by Bootstrap between v4.0.0-beta (twbs/bootstrap#22045) and v4.1.2 (twbs/bootstrap#26767).

License

This project is licensed under the terms of the MIT license.

About

A Babel plugin that strips import and export statements from modules.

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Contributors 3

  •  
  •  
  •