Skip to content

Babel preset for all es2015 plugins but one, babel-plugin-transform-es2015-modules-commonjs.

Notifications You must be signed in to change notification settings

araphel/babel-preset-es2015-native-modules

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DEPRECATED NOTICE

This preset is no longer necessary as the function that it performed can now be achieved natively.

Instead of es2015-native-modules please use es2015 with { "modules": false } option:

presets: [
  ["es2015", { "modules": false }]
]

babel-preset-es2015-native-modules

Babel preset for all es2015 plugins MINUS ONE:

  • babel-plugin-transform-es2015-modules-commonjs

Use case

– A preset without transform-es2015-modules-commonjs would help with tree-shaking when using Babel 6 and webpack 2

Tree-shaking with webpack 2 and Babel 6

Install

$ npm install --save-dev babel-preset-es2015-native-modules

Usage

Via .babelrc (Recommended)

.babelrc

{
  "presets": ["es2015-native-modules"]
}

Via CLI

$ babel script.js --presets es2015-native-modules

Via Node API

require("babel-core").transform("code", {
  presets: ["es2015-native-modules"]
});

About

Babel preset for all es2015 plugins but one, babel-plugin-transform-es2015-modules-commonjs.

Resources

Stars

Watchers

Forks

Packages

No packages published