This example is deprecated in favour of ES6+ in Cloud Functions 2 and it's folder in my blog-examples repo.
Use ES6+ to develop Cloud Functions for Firebase today!
Here is the accompanying Medium post.
Develop your Coud Functions in a different directory to the default ./functions
directory. I suggest ./functionsES6
. Then use babel-cli
, babel-preset-es2015
and rimraf
with some npm scripts to transpile to ES2015 into the default ./functions
directory on deploy (yarn deploy
).
Files of interest:
- Root package.json
- Cloud Functions package.json
- Cloud Functions index.js
git clone https://github.com/jthegedus/firebase-functions-es6-example
cd firebase-functions-es6-example
yarn install
yarn deploy
N.B.: You will need to connect the project to your Firebase project. Edit the name in .firebaserc
Everything was tested on Ubuntu 17.04. If you wish for Windows native support please submit an issue so we can work on a Windows branch. Please report any macOS errors as I do not have access to a device to test. My development environment can be found here.