AveVlad/gulp-connect — pull request #83 by MichielDeMey (2014-11-14 01:03:36+00:00)
Title: LiveReload should be the first middleware function

As stated by the connect-livereload repo:
For use as middleware (...) simply add the following to the **top** of your array of middleware.
https://github.com/intesso/connect-livereload#grunt-example

This fixes the following use-case:

I already have a middleware function defined for fixing the HTML5 push-state feature in the Angular router:
```
middleware: function (connect, options) {
var optBase = (typeof options.base === 'string') ? [options.base] : options.base;
return [modRewrite(['!(\\..+)$ / [L]'])].concat(
optBase.map(function(path){ return connect.static(path); }));
}
```

Middleware.push adds the livereload middleware to the bottom of the array causing it not to load for some reason.
Unshifting the array and adding the livereload middleware to the top of the array however fixes this and loads the LiveReload as intended.