Max Barry
1 min readMar 29, 2018

--

This is a great overview. Thanks!

Maybe the last missing piece is how to make this blend in to a traditional Firebase/Cloud Functions dev experience: compiling with a watch.

Changing the firebase.json and using the firebase-cli to serve the functions will result in trouble as your compiling from ES6 to ES5 ad-hoc (or on deploy).

I added a watch script to my package.json:

"watch": "babel 'src/functions' --watch --out-dir 'dist/functions'",

I run watch in my functions directory in one tab and serve in another. Watch compiles as I type.

There could be some ignores added to both the babel functions because I don’t think you need everything sent to the dist directory.

Secondary question: why put the .babelrc in the src folder? Why not leave it in the root where babel is being run from. I couldn’t understand that.

--

--

Max Barry
Max Barry

No responses yet