@crystal-ball/babel-base
馃敭 Projects - Babel configs
Last updated 3 days ago by crystal-ball-ci .
ISCRepositoryBugsOriginal npmTarballpackage.json
$ cnpm install @crystal-ball/babel-base 
SYNC missed versions from official npm registry.

babel base

Package version NPM downloads Build status Known vulnerabilities Test coverage Maintainability :status      
Renovate Commitizen friendly ZenHub Semantic Release Contributor Covenant :integrations
Contains magic Full of love :flair       


This package generates a base Babel configuration and dependencies for React applications and Node services. Users can customize the generated base configurations to meet the specific needs of any project.


鈿欙笍 Setup

1. Install

npm i @crystal-ball/babel-base -DE
npm i @babel/runtime -E

2. Setup a Babel config

// babel.config.js
'use strict'

const babelBase = require('@crystal-ball/babel-base').default

module.exports = function babelConfigs(api) {
  // Generate base Babel configs for your target project type
  const baseConfigs = babelBase({ env: api.env, target: 'node|react' })

  // Optionally override the base configs as needed

  return baseConfigs
}

3. Setup polyfills

React projects should also setup polyfills for unsupported language features.

npm i core-js regenerator-runtime -E

鈩癸笍 Note that because these packages will be included in the application bundle they should be installed as dependencies.

// src/index.js
/**
 * Polyfill environments, these imports will be transformed to just the
 * polyfills needed to meet the browserslist targets by the `entry` config for
 * `@babel/preset-env`
 */
import 'core-js'
import 'regenerator-runtime/runtime'

Current Tags

  • 1.12.0                                ...           latest (3 days ago)

15 Versions

  • 1.12.0                                ...           3 days ago
  • 1.11.0                                ...           14 days ago
  • 1.10.0                                ...           a month ago
  • 1.9.0                                ...           2 months ago
  • 1.8.0                                ...           3 months ago
  • 1.7.0                                ...           3 months ago
  • 1.6.1                                ...           3 months ago
  • 1.6.0                                ...           4 months ago
  • 1.5.0                                ...           4 months ago
  • 1.4.0                                ...           5 months ago
  • 1.3.0                                ...           5 months ago
  • 1.2.0                                ...           5 months ago
  • 1.1.1                                ...           6 months ago
  • 1.1.0                                ...           6 months ago
  • 1.0.0                                ...           6 months ago

Copyright 2014 - 2017 漏 taobao.org |