Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

babel-preset-alibaba

alibaba-ir36Apache-2.01.1.6

A babel preset for transforming your JavaScript for Alibaba.ir

babel, es6, es2015, es7, babel-presets

readme

babel-preset-alibaba

A babel preset for transforming your JavaScript for Alibaba.ir.

Currently contains transforms for all standard syntax that is stage 4 (ES2017) or stage 3, except for the following:

Install

$ npm install --save-dev babel-preset-alibaba

Usage

.babelrc

{
  "presets": ["alibaba"]
}

Via CLI

$ babel script.js --presets alibaba

Via Node API

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

Targeting Environments

This module uses babel-preset-env to target specific environments.

Please refer to babel-preset-env#targets for a list of available options.

For a list of browsers please see browserlist.

You may override our default list of targets by providing your own targets key.

{
  "presets": [["alibaba", {
    "targets": {
      "chrome": 50,
      "explorer": 11,
      "firefox": 45
    }
  }]]
}

The following transpiles only for Node v6.

{
  "presets": [["alibaba", {
    "targets": {
      "node": 6
    }
  }]]
}

If you wish, you can also inherit our default list of browsers and extend them using additionalTargets.

{
  "presets": [["alibaba", {
    "additionalTargets": {
      "chrome": 42,
      "explorer": 8
    }
  }]]
}