@starlightpro/babel-preset-starlight

Babel preset containing common plugins and presets used at Starlight.

Stats

stars 🌟issues ⚠️updated 🛠created 🐣size 🏋️‍♀️
00Dec 22, 2017Dec 22, 2017Minified + gzip package size for @starlightpro/babel-preset-starlight in KB

Readme

Babel Preset Starlight

Babel preset containing common plugins and presets used at Starlight.

Installation

yarn add --dev @starlightpro/babel-preset-starlight

Babel preset Starlight uses Babel 7.0 (more detail)

⚠️

Usage

{
  "presets": ["@starlightpro/babel-preset-starlight"]
}

Customized

{
  "presets": [
    ["@starlightpro/babel-preset-starlight", {
      "node":true,
      "nodeTarget": "current",
      "env": {
        "debug": false
      },
      "srcDir": "./src"
    }]
  ]
}

Options

runtime BABEL_ENV

Supports either production, development or test

runtime BABEL_OUTPUT

Supports either esm or cjs

Default to esm unless BABEL_ENV is set to test then it defaults to cjs

options.env

All options from @babel/preset-env are available for configuration by adding env: {} to the options object.

See @babel/preset-env documentation.

options.srcDir

string, defaults to not enabled.

babel-plugin-module-resolver is enabled if srcDir: '<src>' is present.

options.node

boolean, defaults to false.

Add node: true to build specifically for node targets. Default is build for browser.

options.nodeTarget

string | number | "current", defaults to '8.9'

allows you to specifically target a node version.

options.additionalTargets

Array<string> | string

Target additional browsers not included in the default browser list targets.

Default browser targets:

[
  'last 4 Chrome major versions',
  'last 3 ChromeAndroid major versions',
  'last 2 ios major versions',
  'last 3 Edge major versions',
  'last 4 Firefox major versions',
  'last 3 Safari versions',
];

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.