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

Package detail

@repay/babel-preset

repaygithub35MIT1.2.0

Babel preset for front end applications

readme

@repay/babel-preset

Babel preset used by @repaygithub

Usage

Install via the command line using yarn or npm

@babel/core, @babel/runtime, and core-js are peer dependencies, which means you must install them yourself.

yarn add --dev @repay/babel-preset @babel/core @babel/runtime core-js
# OR
npm install --save-dev @repay/babel-preset @babel/core @babel/runtime core-js

Add the preset to your .babelrc or equivalent

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

EcmaScript Features Supported

  • All Proposals that have reached stage-4 and are implemented by @babel/preset-env
  • Class Properties (does not include private fields)

    class Accordian extends Component {
      state = { isOpen: this.props.openOnMount || false };
    
      // using assignment like below,
      // `this` references the class instance always
      toggleOpen = () =>
        this.setState(s => {
          isOpen: !s.isOpen;
        });
    }
  • Object rest spread (e.g. let obj = {...props})

Polyfills

There are two options you can pass to control polyfills:

  • coreJsPolyfill (default: false): When this option is true, the useBuiltIns: 'usage' option will be passed into @babel/preset-env to automatically add in only the necessary CoreJS polyfills needed.
  • regeneratorPolyfill (default: false): When this option is true, the regenerator: true option will be passed into the @babel/plugin-transform-runtime plugin.

changelog

v1.1.6 (Fri Sep 20 2024)

🏠 Internal

Authors: 1


v1.1.5 (Tue Feb 07 2023)

🔩 Dependency Updates

Authors: 3


v1.1.4 (Wed Mar 02 2022)

🔩 Dependency Updates

Authors: 1


v1.1.3 (Thu Feb 03 2022)

🐛 Bug Fix

  • Include plugin-proposal-private-property-in-object to silence warning when building projects #103 (@daniloPenaR)

Authors: 1


v1.1.2 (Thu Dec 09 2021)

🔩 Dependency Updates

Authors: 2


v1.1.2 (Thu Dec 09 2021)

🔩 Dependency Updates

Authors: 2


v1.1.2 (Thu Dec 09 2021)

🔩 Dependency Updates

Authors: 2


v1.1.1 (Wed May 26 2021)

🔩 Dependency Updates

Authors: 1


v1.1.0 (Wed Mar 03 2021)

🚀 Enhancement

  • Add sylted-components babel plugin - improves debugging for styled components and reduces bundle size #78 (@daniloPenaR)

Authors: 1


v1.0.2 (Tue Jan 26 2021)

🔩 Dependency Updates

Authors: 1


v1.0.1 (Thu Oct 15 2020)

🔩 Dependency Updates

Authors: 1