Running Node app through Grunt

后端 未结 2 2057
臣服心动
臣服心动 2020-12-16 16:23

I am trying to run my Node application as a Grunt task. I need to spawn this as a child process, however, to allow me to run the watch task in parallel.

This works:<

相关标签:
2条回答
  • 2020-12-16 16:47

    Take a look at grunt-nodemon which handles a lot of the headaches related to spawning a child process.

    0 讨论(0)
  • 2020-12-16 17:02

    This is because grunt-contrib-watch currently spawns all task runs as child processes. So the variable child is not within the same process context. Fairly soon, grunt-contrib-watch@0.3.0 will be released with a nospawn option. This will let you configure the watch to spawn task runs within the same context and would make your above example work.

    Take a look at this issue for a little more information:

    https://github.com/gruntjs/grunt-contrib-watch/issues/45

    0 讨论(0)
提交回复
热议问题