yarn run v1.3.2
$ nodemon --watch --experimental-modules src/index.mjs
Usage: nodemon [nodemon options] [script.js] [args]
See "nodemon --help" for more.
Done in 0.19s.
Logs from 11/16/17 3:11 PM to 11/16/17 3:11 PM
Pass flags to node using --
That's not the problem, the problem is you don't recognize the .mjs extension
I assume you've told nodemon to monitor the mjs extensions?
@remy Going to throw my hat in the ring and say that since .mjs is an official node feature under an experimental flag now and it will be turned on by default in 10.x, it might be worthwhile to add *.mjs as a default monitoring extension rather than require a -e flag.
Your thoughts?
Go for it (via PR I'd assume)
On Sun, 3 Dec 2017, 05:22 Jay Beavers, notifications@github.com wrote:
@remy https://github.com/remy Going to throw my hat in the ring and say
that since .mjs is an official node feature under an experimental flag now
and it will be turned on by default in 10.x, it might be worthwhile to add
*.mjs as a default monitoring extension rather than require a -e flag.Your thoughts?
—
You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub
https://github.com/remy/nodemon/issues/1133#issuecomment-348741370, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAA1hH1OwsWKQZm7l-RryUS8Lc9ST_rcks5s8jAHgaJpZM4QgprY
.
If anyone encounter an issue with nodemon and "_--experimental-modules_" flag, the solution isn't about using "--" flag (as said in https://github.com/remy/nodemon/issues/1133#issuecomment-346776393) but rather use directly nodemon --experimental-modules src/index.mjs
The first proposal will add the "_--experimental-modules_" flag at the end of the command and won't be take into consideration while running. It has to be before the name of the file to work (at least, it was the case for me).
May interest people with the end of Node.js 8 maintenance and new Node.js 10/12 conventions.
(credits to https://stackoverflow.com/questions/56998440/how-to-run-ecmascript-mjs-files-with-nodemon)
Most helpful comment
@remy Going to throw my hat in the ring and say that since .mjs is an official node feature under an experimental flag now and it will be turned on by default in 10.x, it might be worthwhile to add *.mjs as a default monitoring extension rather than require a -e flag.
Your thoughts?