firebase-tools
firebase-tools copied to clipboard
On-change re-compilation of cloud functions when working with TypeScript via Emulator
Description
I noticed when serving Cloud Functions written in TypeScript via the Firebase Emulator, that my changes were not getting recompiled and I had to run npm run serve each time I made a change for them to take effect.
This change adds a --watch parameter to npm run build script supported natively by the installed TypeScript version, and runs the command in parallel to firebase emulators:start --only functions so one doesn't have to re-run the npm run serve script each time a change is made.