【发布时间】:2014-01-06 23:10:36
【问题描述】:
除了watch github page之外,我还咨询了this answer作为起点。
我的监视任务如下所示:
watch: {
less: {
files: ['less/**/*.less'],
tasks: ['less'],
options: {
livereload: true
}
},
handlebars: {
files: ['templates/**/*.hbs'],
tasks: ['handlebars'],
options: {
livereload: true
}
}
}
首先我尝试使用浏览器扩展,然后我在我的 index.html 中添加了这个脚本(并验证它已加载)
<script src="//localhost:35729/livereload.js"></script>
我也尝试将此添加到我的手表 js:
livereload: {
files: ['dev/**/*'],
options: {
livereload: true
}
}
我还有一个连接任务,我尝试运行 grunt 有或没有它都无济于事。
connect: {
dev: {
options: {
port: 35729
}
}
}
仍然没有实时重新加载...
【问题讨论】:
-
您用于启动的确切命令是什么?
标签: javascript gruntjs livereload grunt-contrib-watch