@deuterium/babel-preset
v1.3.0
Published
This package utilizies **babel 7** and allows compiling of ES2015+ to a backwards compatible ES5 standard.
Readme
@deuterium/babel-preset
This package utilizies babel 7 and allows compiling of ES2015+ to a backwards compatible ES5 standard.
Install
You will need to install the base babel 7
Main
yarn add --dev @deuterium/babel-preset @babel/core @babel/preset-envIf you want command line usage, you can use it with babel-node and babel by adding
yarm add --dev @babel/cli @babel/nodePlugins
There are also many optional babel transformations (or plugins) that you can add and it wil be automatically configured to work.
- @babel/plugin-transform-runtime - Reduces bundle size
- @babel/plugin-proposal-pipeline-operator - Allows chaining of functions
- @babel/plugin-proposal-do-expressions - Allows more complex versions of ternary operator
- @babel/plugin-proposal-nullish-coalescing-operator - Allows for testing of
nullorundefinedusing??operating - @babel/plugin-proposal-optional-chaining - Allows for optional testing of nested variables.
To install all of these,
yarn add --dev @babel/plugin-transform-runtime @babel/plugin-proposal-pipeline-operator @babel/plugin-proposal-do-expressions @babel/plugin-proposal-nullish-coalescing-operator @babel/plugin-proposal-optional-chainingUsage
In your package.json, add
"babel": {
"presets": [
"@deuterium"
]
}