Skip to content

Commit

Permalink
feat: add JSON to default watched extensions
Browse files Browse the repository at this point in the history
Since in a server environment JSON files often contain settings,
nodemon should restart by default when the content of a JSON file is changed.

Closes remy#643
  • Loading branch information
pensierinmusica authored and remy committed Oct 19, 2015
1 parent a3b6c3e commit 370d778
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ Now nodemon will only restart if there are changes in the `./app` or `./libs` di

## Specifying extension watch list

By default, nodemon looks for files with the `.js`, `.coffee`, and `.litcoffee` extensions. If you use the `--exec` option and monitor `app.py` nodemon will monitor files with the extension of `.py`. However, you can specify your own list with the `-e` (or `--ext`) switch like so:
By default, nodemon looks for files with the `.js`, `.coffee`, `.litcoffee`, and `.json` extensions. If you use the `--exec` option and monitor `app.py` nodemon will monitor files with the extension of `.py`. However, you can specify your own list with the `-e` (or `--ext`) switch like so:

nodemon -e js,jade

Expand Down
4 changes: 2 additions & 2 deletions lib/config/exec.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ function exec(nodemonOptions, execMap) {
if (options.exec === 'coffee') {
// don't override user specified extension tracking
if (!options.ext) {
extension = 'coffee litcoffee js';
extension = 'coffee litcoffee js json';
}

// because windows can't find 'coffee', it needs the real file 'coffee.cmd'
Expand Down Expand Up @@ -184,4 +184,4 @@ function exec(nodemonOptions, execMap) {
}

return options;
}
}

0 comments on commit 370d778

Please sign in to comment.