I am working on a small node project and I use coffeescript and less for client-side code. I am trying to set up my development environment using grunt. I've implemented custom grunt task for running server like this:
start = require './start' #just a function to start express.js application
grunt.registerTask 'server', 'Starting server', ->
grunt.log.write 'Preparing server to start'
done = do @async
start (err) ->
grunt.log.write "server running at localhost:4000"
I also want to run the "watch" task using grunt-contrib-watch plugin:
grunt.initConfig
watch:
coffee:
files: ['public/coffee/**/*.coffee']
tasks: ['coffee']
jade:
files: ['public/jade/**/*.jade']
tasks: ['jade']
less:
files: ['public/less/**/*.less']
tasks: ['less']
The question is: How to make this two tasks (watch and server) run simultaneously? I want to have a server up and running and don't want to reload it every time some client-side code is changed. Thanks in advance