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.
Is there a way to monitor changes like "nodemon" for Firebase command line?
3.4k Views Asked by TheBen At
3
There are 3 best solutions below
0
On
I'm using nodemon with firebase cloud function, as [email protected] (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
0
On
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.
This is not currently a feature of the Firebase CLI, but it sounds like something that would be useful. Please file a feature request.