在少文件中出现语法错误时,防止`grunt-watch`循环播放? [英] Prevent `grunt-watch` from looping when there is a syntax error in less files?
问题描述
我使用 grunt-watch
来重建我的少量样式表:
I'm using grunt-watch
to re-build my less style sheets:
watch: {
less: {
files: ['media/less/**/*.less'],
tasks: ['less'],
options: {
atBegin: true,
spawn: false
}
}
}
但是,如果任何 .less
文件中存在语法错误,该任务只会循环,试图每秒重新构建 .less
文件......这使得调试变得相当困难,因为错误消息非常快地滚动过去。
But if there is a syntax error in any of the .less
files, the task just loops, trying to re-build the .less
files every second… which makes debugging fairly difficult, because the error messages scroll past very quickly.
有没有办法解决这个问题,所以 grunt-watch
只会在 .less
文件已被重新更改?
Is there any way fix that, so grunt-watch
will only re-run the task once the .less
files have been changed again?
这是使用:
This is using:
grunt@0.4.2
grunt-contrib-less@0.8.3
grunt-contrib-watch@0.5.3
推荐答案
我认为你所描述的问题是这一个,这是固定在主,但尚未发布(截至2013年12月17日)。
I think the issue you're describing is this one, which was fixed in master but hasn't yet been released (as of 2013/12/17).
这篇关于在少文件中出现语法错误时,防止`grunt-watch`循环播放?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!