grunt-contrib-watch
grunt-contrib-watch copied to clipboard
sharing livereload with other concurrent tasks
I'm using watch and nodemon with concurrent.
The problem is that nodemon restarts when server files change but only watch triggers livereload
currently, I use watch for watching server files and a simple '2SecDelay' task that gives nodemon time to restart the server.
So, I got a patch, but it's ugly:
grunt.registerTask '2SecDelay', 'just taking some time', ->
done = @async()
setTimeout((() -> done()), 2000)
...
nodemon:
server:
... run server and watch server related files ...
watch:
server:
files: ... same files as the nodemon watches ...
tasks: ['2SecDelay']
concurrent:
server:
['nodemon', 'watch']
any suggestions?