2016-07-13 27 views
1

我正在开发一个没有后端/服务器的小型HTML/JS/SASS项目,我试图让Livereloading工作。使用Grunt手表Livereload本地URL

在我grunt.initConfig我:

options: { 
    livereload: true, 
}, 

但在Chrome中我不能激活本地HTML文件Liverload插件。

文件:/// C:/Users/alucardu/Documents/Visual%20Studio%202015/Projects/JS-demo/JS-demo/index.html

这是可以做到的还是我需要运行服务器?

回答

0

显然咕噜呼吁connect>https://github.com/gruntjs/grunt-contrib-connect

东西这个当我安装了它,我已将此添加到我的gruntFile:

connect: { 
     server: { 
      options: { 
       open: true, 
       keepalive: true, 
       hostname: 'localhost', 
       port: 8080, 
       base: '' 
      } 
     } 
    }, 

现在我可以运行本地静态服务器:)