gruntjs / grunt-contrib-connect

Start a static web server.
http://gruntjs.com
MIT License
714 stars 146 forks source link

Configure other options to livereload #186

Closed thiago closed 6 years ago

thiago commented 9 years ago

Hello, I need specify a new src to livereload script loaded from my page to use a proxy.

Reading the livereload documentation I see that is possible, but from grunt-contrib-connect options It's not possible.

My sugestion is change the conditions to receive complete livereload options too if it is passed.

Example:

connect: {
   options: {
      port: 8080,
      hostname: 'localhost',
      livereload: {
         port: 35729,
         src: '/livereload/livereload.js'
      }
   }
...

ps: Sorry my english is very bad!

jamey-taylor commented 8 years ago

Agreed. grunt-contrib-connect handles the libreload attribute different than libreload.js. grunt-contrib-connect always expects a number. But it should accept either a number or an object.

To get libreload working on https on an alternate port, I patched my local copy near TODO comment at line 135 of /tasks/connect.js with

      var port = (typeof options.livereload === 'object' && options.livereload.port) ? options.livereload.port : livereload;
          middleware.unshift(injectLiveReload({port: port }));
XhmikosR commented 6 years ago

Duplicate of #100.