grunt-contrib-watch:{tinylr:“ Welcome”,版本:“ 0.0.4”}

达韦达夫

我正在尝试使用grunt-contrib-watch和grunt-contrib-compass使grunt工作。

到目前为止,我的Gruntfile看起来像这样:

module.exports = function (grunt){

    grunt.initConfig({

    compass : {

        dist : {
        options : {
            debugInfo : 'true'          
        }

        }

    },

    watch : {       
        files : ['*.html', 'js/*', 'sass/*'],
        task : ['compass'],
        options : {
        livereload: true,
        port : 35729
        }       
    }

    });


    grunt.loadNpmTasks('grunt-contrib-watch') ;
    grunt.loadNpmTasks('grunt-contrib-compass') ;

    grunt.registerTask('default', ['watch'])

} ;

我正在使用chromes live-reload扩展程序。

如果然后运行'grunt -v',我可以看到grunt按预期监视了我的html和sass文件。我的浏览器选项卡会按预期自动重新加载。

在浏览器标签中,我转到以下地址:

http://localhost:35729

但是,在我的浏览器中,只有在加载和重新加载后才能看到此信息:

{
tinylr: "Welcome",
version: "0.0.4"
}

我没有看到index.html。只是对象。

我需要做什么才能看到我的网站?

凯尔·罗宾逊·杨(Kyle Robinson Young)

http://localhost:35729是实时重新加载服务器的地址,而不是您的网站。您的网站仍然需要通过其自己的地址/端口进行访问,例如http://localhost:8000通过grunt-contrib-connect任务,其他一些node.js服务器或提供文件apache / nginx的服务器。

http://localhost:35729仅用于将实时重新加载脚本加载到您的页面中:<script src="http://localhost:35729/livereload.js"></script>然后在更改后将使用Web套接字触发并更新您网站上的页面。

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

grunt-contrib-watch + grunt-rsync

来自分类Dev

如何仅在需要时使用grunt-contrib-watch和grunt-contrib-coffee编译CoffeeScript?

来自分类Dev

使用grunt-contrib-connect和grunt-contrib-watch进行实时重载

来自分类Dev

带livereload的grunt-contrib-watch,带vs,不带grunt-contrib-connect,带livereload

来自分类Dev

grunt-contrib-watch + sass:如何指定目标文件?

来自分类Dev

为什么grunt-contrib-watch livereload无法正常运作?

来自分类Dev

Gruntfile with grunt-contrib-watch, browserify, and hbsfy (handlebars) - Automate transform

来自分类Dev

grunt-contrib-watch未绑定递归错误

来自分类Dev

grunt-contrib-watch是否有不同的输出样式?

来自分类Dev

Grunt-Live Reload无法与Grunt-Contrib-Watch配合使用

来自分类Dev

Grunt-Live Reload无法与Grunt-Contrib-Watch配合使用

来自分类Dev

使用grunt-contrib-handlebars版本问题预编译车把

来自分类Dev

带有contrib-watch的grunt-express服务器

来自分类Dev

带有grunt-contrib-watch,browserify和hbsfy(把手)的Gruntfile-自动转换

来自分类Dev

在asp.net-vnext和Visual Studio 15中使用Grunt-Contrib-Watch

来自分类Dev

grunt-contrib-watch导致超出最大调用堆栈大小

来自分类Dev

Grunt:contrib-watch编译服务器端.coffee文件时,在重启grunt-nodemon后触发livereload事件

来自分类Dev

Grunt:contrib-watch当编译服务器端.coffee文件时,在重启grunt-nodemon后触发livereload事件

来自分类Dev

系统和grunt-contrib-compass之间的SASS版本不匹配?

来自分类Dev

系统和grunt-contrib-compass之间的SASS版本不匹配?

来自分类Dev

Grunt - Watch new folders

来自分类Dev

grunt exec死机,期望django collectstatic的状态码为0

来自分类Dev

如何找出哪个磁盘是“ SD 0:4:0:0”

来自分类Dev

如何在Grunt中定义clean-css属性以防止将0%转换为0

来自分类Dev

Grunt watch interrupt not working with jekyll

来自分类Dev

在livereload中使用grunt watch

来自分类Dev

grunt-contrib-requirejs敲除组件问题

来自分类Dev

在凉亭中使用grunt-contrib-concat

来自分类Dev

grunt-contrib-uglify输出为空

Related 相关文章

  1. 1

    grunt-contrib-watch + grunt-rsync

  2. 2

    如何仅在需要时使用grunt-contrib-watch和grunt-contrib-coffee编译CoffeeScript?

  3. 3

    使用grunt-contrib-connect和grunt-contrib-watch进行实时重载

  4. 4

    带livereload的grunt-contrib-watch,带vs,不带grunt-contrib-connect,带livereload

  5. 5

    grunt-contrib-watch + sass:如何指定目标文件?

  6. 6

    为什么grunt-contrib-watch livereload无法正常运作?

  7. 7

    Gruntfile with grunt-contrib-watch, browserify, and hbsfy (handlebars) - Automate transform

  8. 8

    grunt-contrib-watch未绑定递归错误

  9. 9

    grunt-contrib-watch是否有不同的输出样式?

  10. 10

    Grunt-Live Reload无法与Grunt-Contrib-Watch配合使用

  11. 11

    Grunt-Live Reload无法与Grunt-Contrib-Watch配合使用

  12. 12

    使用grunt-contrib-handlebars版本问题预编译车把

  13. 13

    带有contrib-watch的grunt-express服务器

  14. 14

    带有grunt-contrib-watch,browserify和hbsfy(把手)的Gruntfile-自动转换

  15. 15

    在asp.net-vnext和Visual Studio 15中使用Grunt-Contrib-Watch

  16. 16

    grunt-contrib-watch导致超出最大调用堆栈大小

  17. 17

    Grunt:contrib-watch编译服务器端.coffee文件时,在重启grunt-nodemon后触发livereload事件

  18. 18

    Grunt:contrib-watch当编译服务器端.coffee文件时,在重启grunt-nodemon后触发livereload事件

  19. 19

    系统和grunt-contrib-compass之间的SASS版本不匹配?

  20. 20

    系统和grunt-contrib-compass之间的SASS版本不匹配?

  21. 21

    Grunt - Watch new folders

  22. 22

    grunt exec死机,期望django collectstatic的状态码为0

  23. 23

    如何找出哪个磁盘是“ SD 0:4:0:0”

  24. 24

    如何在Grunt中定义clean-css属性以防止将0%转换为0

  25. 25

    Grunt watch interrupt not working with jekyll

  26. 26

    在livereload中使用grunt watch

  27. 27

    grunt-contrib-requirejs敲除组件问题

  28. 28

    在凉亭中使用grunt-contrib-concat

  29. 29

    grunt-contrib-uglify输出为空

热门标签

归档