4

I am using a firebase emulator to develop and test cloud functions. Every time I modify an existing function or when I want to add a new function, I essentially shut down the emulator, deploy the functions, and then restart the emulator. In this process, I lose all the data in the local firestore database (as a part of the emulator). Is there a way to deploy functions to incorporate modifications to existing functions as well as to include new functions without shutting down the emulator?

Doug Stevenson
  • 297,357
  • 32
  • 422
  • 441
Kanishk
  • 41
  • 2

1 Answers1

1

It seems to depend what you are deploying. There is a not in Firebase documentation:

Note: Code changes you make during an active session are automatically reloaded by the emulator. If your code needs to be transpiled (TypeScript, React) make sure to do so before running the emulator.

So if you generally you can run the emulator and when you change the code without stopping it, with exception of the languages mentioned in the note.

Dharman
  • 30,962
  • 25
  • 85
  • 135
vitooh
  • 4,132
  • 1
  • 5
  • 16
  • Found it. Thanks a lot. – Kanishk Aug 05 '20 at 11:00
  • **NOTE:** This does not apply if you have multiple functions in multiple files outside of `index.js` when using [this](https://firebase.google.com/docs/functions/organize-functions) structure – Paul Jan 04 '22 at 16:46