Skip to content

Commit

Permalink
docs: how to watch .env files
Browse files Browse the repository at this point in the history
[skip ci]
  • Loading branch information
remy committed Nov 28, 2018
1 parent 21e052e commit 2dcdd0e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,18 @@ In your `nodemon.json` (or in your `package.json`) you can include the follow ev
}
```

# nodemon doesn't restart on .env change

This is an edge case with how nodemon watches files. This is because nodemon doesn't know if `.env` is a hidden file with no extension or a `*.env` without a filename.

Nonetheless, to trigger a change on `.env` (or similar files like `.bash_profile`), you need to explicitly tell nodemon to watch the file.

However, now nodemon will *only* watch the `.env` file, so you need to add to what nodemon is watching, i.e. tell nodemon to _also_ watch the current working directory:

```bash
$ nodemon --watch .env --watch app app/index.js
```

# nodemon doesn't work with my REPL

Create an nodemon.json file with the setting:
Expand Down

0 comments on commit 2dcdd0e

Please sign in to comment.