Skip to content

Latest commit

History

History

functions-w-babel

Folders and files

NameName
Last commit message
Last commit date

parent directory

..

Cloud Functions with Babel

Compile your Cloud Functions with Babel enabling newer JavaScript syntax and features.

The theory medium post covers the basic configuration compiling Cloud Functions requires. The subsequent medium post covers the actual setup for each variation.

Usage

# install
yarn
# setup: setup firebase config to deploy
yarn setup
# build
yarn build
# or use watch
yarn watch
# locally test
yarn serve
# deploy to firebase
yarn deploy

Flow

If you wish to use Flow with this setup make the following changes:

# add deps
yarn add -D @babel/preset-flow

and add the Flow preset to the .babelrc file as such:

{
  "presets": [
    [
      "@babel/preset-env",
      {
        "targets": { "node": "8.16.0" }
      }
    ],
    ["@babel/preset-flow"]
  ]
}