grunt-reload icon indicating copy to clipboard operation
grunt-reload copied to clipboard

Clearer Documentation on how to setup livereload

Open joeybaker opened this issue 12 years ago • 1 comments

I've been figure out how to enable the "livereload" functionality of grunt-reload (no page refreshes for css/image changes), and have so far been unsuccessful.

The Readme states:

...
    port: 35729, // LR default
    liveReload: {}
...

…is necessary work with the livereload extension. This appears to be true, using the livereload browser extension will trigger a full page refresh, but not trigger the "livereload" capabilities.

Then, in the tests:

            liveReloadTest: {
                // test at any URL with LR extension enabled
                port: 35729, // LR default
                liveReload: {
                    apply_css_live: true,
                    apply_images_live: true
                }
            },

The extra options under liveReload aren't documented, (and seem to have no effect)?

All of which leaves me with several questions:

  • What's the proper way to get "livereload" functionality from grunt-reload? (It appears that a blocking issue is: https://github.com/gruntjs/grunt-contrib-watch/pull/41)
  • #3 asks for a modification for client.js (actually reloadClient.js). How is it that simply using livereload.js doesn't solve the problem?

joeybaker avatar Feb 06 '13 18:02 joeybaker

FWIW, the Gruntfile I'm working with looks something like this:


  , watch: {
      sass: {
        files: 'assets/sass/**/*.scss'
        , tasks: ['compass:dev']
        , interrupt: true
      }
      , css: {
        files: 'assets/css**/**/*.css'
        , tasks: ['reload']
        , interrupt: true
      }

…

    , reload: {
      port: 35729 // LR default
      , liveReload: {
        'apply_css_live': true
        , 'apply_images_live': true
      }
      , proxy: {
        host: 'localhost'
        , port: 8888
      }
    }

…

  grunt.registerTask('code', ['reload', 'watch'])

joeybaker avatar Feb 06 '13 18:02 joeybaker