babel-preset-cellular
v1.1.0
Published
Babel preset used at CELLULAR
Downloads
8
Readme
babel-preset-cellular
This package includes the Babel preset used at CELLULAR.
Presets:
Plugins:
- add-react-displayname
- glamorous-displayname
- syntax-dynamic-import
- transform-decorators-legacy
- transform-class-properties
- transform-object-rest-spread
- minify-dead-code-elimination
When NODE_ENV or BABEL_ENV is test
:
Usage in cellular-scripts projects
The easiest way to use this configuration is with cellular-scripts, which includes it by default. You don’t need to install it separately.
Usage outside of cellular-scripts
If you want to use this Babel preset in a project not built with cellular-scripts, you can install it with following steps:
First, install Babel.
Then install babel-preset-cellular.
npm install babel-preset-react-app --save-dev
Then create a file named .babelrc
with following contents in the root folder of your project:
{
presets: ["cellular"]
}
Options
If your project doesn't use flow, react or glamorous you can turn off these plugins to speed up the processing:
{
presets: [
[
"cellular",
{
flow: false,
react: false,
displayname: false,
glamorous: false,
}
]
]
}
NOTE: If you use this preset with cellular-scripts this will be done automatically.
License
MIT