Gruntjs Livereload无法正常工作

时间:2014-11-29 18:42:20

标签: gruntjs livereload

我似乎无法使用livereload选项来处理grunt-contrib-watch任务。

我的html文件底部附有本地主机livereload.js文件。

当我去http://localhost:35729/时,我得到的是以下内容:

{" tinylr":"欢迎","版本":" 0.0.5"}

似乎所有东西都设置正常。即使我运行grunt --verbose,它也说实时重装服务器在端口上启动:35729。

以下是我的gruntfile中的手表配置

任何帮助将不胜感激!

      watch: {
        options:{
            livereload: true,
        }

        styles: {
            files: ['less/**/*.less'], // which files to watch
            tasks: ['less'],
            options: {
                nospawn: true
            }
        },
        html:{
            files: ['site/**/*.html', 'includes/**/*.html'],
            tasks: ['includes'],
            options: {
                nospawn: true,
            }
        }

    }
}); 

1 个答案:

答案 0 :(得分:0)

您看到的输出是正确的。 http://localhost:35729是LiveReload服务器,而不是您的应用。

查看您的代码,您尚未在index.html中包含LiveReload脚本。

我已向您发送拉取请求,可以确认LiveReload正在运行。