Skip to content

Commit 5a89df6

Browse files
JayBeaversremy
authored andcommitted
fix: Support for .mjs es6 modules (#1138)
1 parent 9b6c786 commit 5a89df6

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ Don't use unix globbing to pass multiple directories, e.g `--watch ./lib/*`, it
155155

156156
## Specifying extension watch list
157157

158-
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:
158+
By default, nodemon looks for files with the `.js`, `.mjs`, `.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:
159159

160160
nodemon -e js,jade
161161

doc/cli/help.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
-- <your args> ........... to tell nodemon stop slurping arguments.
2424

2525
Note: if the script is omitted, nodemon will try to read "main" from
26-
package.json and without a nodemon.json, nodemon will monitor .js, .coffee,
26+
package.json and without a nodemon.json, nodemon will monitor .js, .mjs, .coffee,
2727
and .litcoffee by default.
2828

2929
To learn more about nodemon.json config: nodemon --help config

lib/config/exec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ function exec(nodemonOptions, execMap) {
141141
if (options.exec === 'coffee') {
142142
// don't override user specified extension tracking
143143
if (!options.ext) {
144-
extension = 'coffee,litcoffee,js,json';
144+
extension = 'coffee,litcoffee,js,json,mjs';
145145
}
146146

147147
// because windows can't find 'coffee', it needs the real file 'coffee.cmd'

0 commit comments

Comments
 (0)