Skip to content
This repository has been archived by the owner on Apr 29, 2023. It is now read-only.

charlie-tango/babel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@charlietango/babel

Babel preset to configure a setup that allows us to work with React alongside Flow or Typescript.

Installation

Install the preset from NPM:

yarn add @charlietango/babel --dev

Create a file named .babelrc with following contents in the root folder of your project:

{
  "presets": ["@charlietango/babel"]
}

Extra plugins

  • babel-plugin-lodash - Ensures lodash is optimized when imported
  • babel-plugin-macros - Enable support for macros
  • react-hot-loader - Support hot reloading of react

CSS-in-JS

If you need to use a CSS-in-JS framework, you should add the presets/plugins to the babel configuration according to the documentation.

{
  "plugins": ["babel-plugin-styled-components"]
}
{
  "presets": ["@emotion/babel-preset-css-prop"]
}