我不得不在grunt watch中重写我的一个手表事件
grunt.event.on 'watch', (action, filepath, target) ->
# does something ...如何在结束时手动触发livereload?
grunt.task.run('livereload'....)?发布于 2014-06-04 17:38:56
我通过只在一个文件上设置livereload来解决这个问题,这个文件是我在进程结束时编写的。
下面是一个示例:
module.exports = (grunt) ->
grunt.initConfig
watch:
reload:
options:
livereload: true
files: "refresh.txt"
css:
files: ["**/*.css"]
js:
files: ["**/*.js]
# ... and all your tasks
grunt.event.on 'watch', (action, filepath, target) ->
# does something ...
if target isnt 'reload'
data = "#{grunt.template.today("isoDateTime")}\n"
require('fs').appendFileSync "refresh.txt", datahttps://stackoverflow.com/questions/22949096
复制相似问题