grunt-contrib-watch icon indicating copy to clipboard operation
grunt-contrib-watch copied to clipboard

sharing livereload with other concurrent tasks

Open amitport opened this issue 10 years ago • 2 comments

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?

amitport avatar Dec 15 '13 13:12 amitport