@sharyn/babel-preset
v3.1.3
Published
[![npm](https://img.shields.io/npm/v/@sharyn/babel-preset.svg)](https://www.npmjs.com/package/@sharyn/babel-preset)
Downloads
55
Readme
🌹 @sharyn/babel-preset
You can use this package as a standalone, but I recommend following the development setup tutorial to also install ESLint, Flow, Jest, React, and their Babel-related plugins.
🌹 Install
Minimal install:
yarn add --dev @sharyn/babel-preset @babel/core
Add to your package.json
:
"babel": {
"presets": [
"@sharyn"
]
},
🌹 Auto-configured Modules
The following supported modules are automatically configured for Babel if they are detected in your package.json
:
- @babel/plugin-proposal-do-expressions – To use
do { }
expressions - @babel/plugin-proposal-nullish-coalescing-operator – To use
isUndef ?? 'default'
- @babel/plugin-proposal-optional-chaining – To use
isUndef?.property
- @babel/plugin-proposal-pipeline-operator – To use
'hello' |> console.log
- @babel/plugin-syntax-dynamic-import – Dynamic
import()
- @babel/preset-env – The latest Babel preset
- @babel/preset-flow – The Babel preset for Flow
- @babel/preset-react – The Babel preset for React
- babel-plugin-flow-react-proptypes – Generate PropTypes from Flow annotations
- babel-plugin-module-resolver – To import
from 'foo'
instead of'../../foo'
See the implementation.
Note: Flow does not support the pipeline operator yet.