Make watch not break down on error thrown by grunt-express-server

时光怂恿深爱的人放手 提交于 2019-12-11 09:48:18

问题


I use Yeoman to do some angular development with grunt, livereload etc.

I've also set up a basic node.js/express app and I'm sharing some JS between the client (angular) and the server (node) using grunt-contrib-copy and grunt-express-server that fires on every file-save using watch. So far so good!

The problem is if I introduce a syntax error into the code that I want to share with node and hit save. The syntax error gets shown in the log and breaks/stops the watch. Then I have to go restart the watch in the console by doing $ ctrl+c and $ grunt server.

Is there a way to get grunt-express-server not to break/stop the watch that's going on if a syntax error is found in the js code?


回答1:


I'm the author of grunt-express-server and working the issue here:

https://github.com/ericclemmons/grunt-express-server/issues/27

I've been able to work around this problem by running grunt-parallel or grunt-concurrent, which prevents errors from preventing execution of watch.



来源:https://stackoverflow.com/questions/19629946/make-watch-not-break-down-on-error-thrown-by-grunt-express-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!