Npms_big

babel-preset-es2015

6.24.0

Babel preset for all es2015 plugins.

Critical or Security advisories for 6.24.0

This version doesn't have any advisory. Want to report one?

Changelog for 6.24.0

6.24.0 (2017-03-13)

A quick release for 2 features:

  • Thanks to @rwjblue, there is now a noInterop option for our es2015-modules transform to remove the interopRequireDefault and interopRequireWildcard helpers.

Input

js import foo from "foo"; foo;

Regular Output

js var _foo = require("foo"); var _foo2 = _interopRequireDefault(_foo); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } _foo2.default;

Output with option noInterop

js "use strict"; var _foo = require("foo"); (0, _foo.default)();

This also helps ember-cli migrate to Babel 6.

  • @izaakschroeder has added dirname to the preset constructor which presets can use to resolve things relative to files.

Example usage of fileContext.dirname in a preset

js module.exports = function preset (context, options, fileContext) { if (/resolve-addons-relative-to-file$/.test(fileContext.dirname)) { return { plugins: ['plugin-here'], }; } return {}; };

This will help out with reusing a browserslist file for babel-preset-env and for plugins like https://github.com/tleunen/babel-plugin-module-resolver.

:rocket: New Feature

  • babel-plugin-transform-es2015-modules-amd, babel-plugin-transform-es2015-modules-commonjs
  • babel-core

:bug: Bug Fix

  • babel-generator
    • #5453 Keep parentheses for logical expression when in await expression. (@aaronang)
    • #5339 Wrap some generated do expressions in parens. (@zjmiller)
  • babel-generator, babel-plugin-transform-object-rest-spread

:memo: Documentation

:house: Internal

Committers: 14

Dependencies for 6.24.0

Name Requirement Status
^6.24.0

^6.24.0

^6.22.0

^6.22.0

^6.22.0

^6.22.0

^6.22.0

^6.22.0

^6.22.0

^6.22.0

Display all

My projects using babel-preset-es2015

Name Locked version Requirement
You should be logged in to see which of your projects use babel-preset-es2015.