alt
alt

Reputation: 13907

Forward Node log through Grunt

So I'm using grunt so start my node app:

grunt.registerTask 'start', ->
  grunt.util.spawn
    cmd: 'coffee'
    args: ['./server/server.coffee']

  grunt.log.write "Started server..."

  grunt.task.run 'watch'

But the logs coming from Node are very useful. How can I continue to start my server with Grunt (so it'll do watch) but see the Node log instead of or in addition to the Grunt log?

Upvotes: 0

Views: 209

Answers (1)

robertklep
robertklep

Reputation: 203359

I had the same issue recently and solved it like this:

grunt.util.spawn
  cmd: 'coffee'
  args: ['./server/server.coffee']
  opts:
    stdio : 'inherit'

Upvotes: 2

Related Questions