Skip to content

Commit 370d778

Browse files
pensierinmusicaremy
authored andcommitted
feat: add JSON to default watched extensions
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 #643
1 parent a3b6c3e commit 370d778

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ Now nodemon will only restart if there are changes in the `./app` or `./libs` di
128128

129129
## Specifying extension watch list
130130

131-
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:
131+
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:
132132

133133
nodemon -e js,jade
134134

lib/config/exec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ function exec(nodemonOptions, execMap) {
146146
if (options.exec === 'coffee') {
147147
// don't override user specified extension tracking
148148
if (!options.ext) {
149-
extension = 'coffee litcoffee js';
149+
extension = 'coffee litcoffee js json';
150150
}
151151

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

186186
return options;
187-
}
187+
}

0 commit comments

Comments
 (0)