Is there any way to get the Firebase command line to simply refresh the server as I am applying changes to code similar to what nodemon does for nodeJS? I'm working with Polymer for web.
Asked
Active
Viewed 3,298 times
3 Answers
17
adding to @grigson, you can also use the exec flag to run a package.json script eg:
nodemon -e ts --exec "npm run serve"
where serve is the command in your functions package.json (ie.
{
"name": "functions",
"scripts": {
...
"serve": "npm run build && firebase serve --only functions",
...
}
By running this, nodemon will also run build before serve. The -e flag tells nodemon to watch for changes in files with a .ts extension.

M.Lewis
- 961
- 8
- 18
15
I'm using nodemon with firebase cloud function, as firebase-tools@3.17.4 (current)
firebase serve --only functions
detects changes only in index.js
this can be handled with nodemon --exec
flag
nodemon --exec firebase serve --only functions

grigson
- 3,458
- 29
- 20
3
This is not currently a feature of the Firebase CLI, but it sounds like something that would be useful. Please file a feature request.

Frank van Puffelen
- 565,676
- 79
- 828
- 807
-
2The Firebase Hosting CLI actually monitors the source folder and reloads when there are changes. If there are changes under there, they should be picked up. If you're having problems getting that to work, I'd open a new question with the [minimal steps on how to reproduce that problem](http://stackoverflow.com/help/mcve). – Frank van Puffelen Jan 14 '20 at 20:33