TheBen
TheBen

Reputation: 3522

Is there a way to monitor changes like "nodemon" for Firebase command line?

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.

Upvotes: 7

Views: 3616

Answers (3)

M.Lewis
M.Lewis

Reputation: 1041

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.

Upvotes: 19

grigson
grigson

Reputation: 3726

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

Upvotes: 16

Frank van Puffelen
Frank van Puffelen

Reputation: 598708

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

Upvotes: 4

Related Questions