Code Monkey home page Code Monkey logo

babel-preset-kensho's Introduction

babel-preset-kensho

Build Status npm

This Babel 7 preset transpiles ES2018, JSX, and selected language proposals. It also includes optimizations for specific contexts.

Install

npm install -D babel-preset-kensho

Usage

You can set up Babel transpilation in several ways (e.g. via CLI, or through webpack). Choose a method, and configure Babel to include the preset, e.g. in a .babelrc:

{
  "presets": ["kensho"]
}

Options

The preset can be configured using several options. Note that some options' defaults depend on the Babel environment, which may be one of: development | production | test | cjs | esm

emotion

false | options
Default: false

Whether to enable support for CSS-in-JS via Emotion. If an options object is passed, it is forwarded to the Emotion preset. This option requires an additional dependency on @emotion/core.

include

Array<string|RegExp>
Default: ['@babel/plugin-proposal-optional-chaining', '@babel/plugin-proposal-nullish-coalescing-operator']

List of plugins to always include. Forwarded to the corresponding option in @babel/preset-env.

loose

true | false
Default: true

Whether to enable loose mode in all presets/plugins that support this option.

modules

false | 'commonjs'
Default: 'commonjs' in test and cjs envs, false otherwise

Whether to compile ESM imports/exports to another module format.

// false:
import foo from './foo'

// 'commonjs' (roughly):
const foo = require('./foo')

react

false | options
Default: {}

Whether to transpile JSX expressions. If an options object is passed, it is forwarded to the React preset.

reactRefresh

false | options
Default: {} in development env if react is enabled

Whether to transform React function components for fast refresh. If an options object is passed, it is forwarded to the React Refresh plugin. The list of available options is not currently documented.

This option should only ever be enabled in development. It also requires bundler integration because the output code references global variables containing the Refresh runtime. If this integration cannot be added to a project's development environment, this option should be disabled.

runtime

true | false
Default: true

Whether to enable the Babel runtime transform. This is encouraged to reduce bundle size, but requires adding @babel/runtime as a dependency.

targets

See @babel/preset-env options documentation.
Default: current node version in test environment, inferred from browserslist config otherwise

The transpilation targets to pass to @babel/preset-env.

typescript

false | options
Default: {}

Whether to enable TypeScript support. If an options object is passed, it's passed to the TypeScript preset.

babel-preset-kensho's People

Contributors

billyjanitsch avatar greenkeeper[bot] avatar nabeel- avatar slowki avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.