@crystal-ball/babel-base
TypeScript icon, indicating that this package has built-in type declarations

4.0.0 • Public • Published

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')

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

  /* Optionally override the base configs as needed... */

  return baseConfigs
}

React projects

1. Install packages

# Install polyfills included in application bundle
npm i core-js regenerator-runtime -E

# Install Linaria preset as a dev dependency
npm i @linaria/babel-preset react-refresh -DE

2. Import polyfills

// 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'

Readme

Keywords

Package Sidebar

Install

npm i @crystal-ball/babel-base

Weekly Downloads

1

Version

4.0.0

License

ISC

Unpacked Size

46 kB

Total Files

22

Last publish

Collaborators

  • dhedgecock
  • evrowe
  • chadtmiller
  • crystal-ball-ci