babel-preset-kensho

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
.
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.
import foo from './foo'
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.
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.