I am playing with firebase functions. Works fine when deploying to firebase server using command
firebase deploy --only functions. However, I would like to test my functions locally before deploy to server of course. What I see running firebase serve is that the functions “deployed” locally have not the latest changes I did in indext.ts – are running the last builded version, which are in index.js.
My question is, How do I manual build my firebase functions project to test them locally with latest changes?
firebase serve autobuild the project before deploy it locally? For me, it sounds like a bug.
If you want to reload the changes to your TypeScript when running
firebase functions:shell all you have to do is build your project again using npm script that was created for you when you initialized the project (see package.json):
npm run serve
Also, if you are a more advanced TypeScript user, you can run
tsc --watch to automatically compile TS to JS when source files change on disk. You can read more about that in this blog.