As the title says, I'm using the gulp-nodemon
module in my gulp file to have nodemon restart my server when it detects a file change:
gulp.task('default', function() {
nodemon({ script: 'dist/server/main.js',
tasks: ['server', 'bundle', 'css', 'ejs'],
ext: 'ejs js json'
}).on('restart', function() {
console.log('Restarted!');
});
});
All the tasks I have listed are basic build tasks. When I change a file, the server restarts, but future changes are ignored:
What's more is that if I interrupt the process (CTRL+C
) nodemon shows the restart message as if 2 instances are running at the same time:
Am I doing something wrong with gulp-nodemon
? Or just gulp
in general?
I found out this was an issue with
gulp-nodemon
. It doesn't look like it will get fixed any time soon. I suggest searching for an alternative.https://github.com/JacksonGariety/gulp-nodemon/issues/70