Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,22 @@ gulp.task('webserver', function() {
}));
});
```
#### How can i decrease the polling interval for livereload?
**Solution**: To override the default interval of 5007 ms, set `enable:true` and `pollingInterval` to desired interval.

For example:

```js
gulp.task('webserver', function() {
gulp.src('app')
.pipe(webserver({
livereload: {
enable: true, // need this set to true to enable livereload
pollingInterval: 200 // poll fs every 200ms
}
}));
});
```

#### How can I kill the running server?

Expand Down
4 changes: 3 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ module.exports = function(options) {
livereload: {
enable: false,
port: 35729,
pollingInterval: 5007,
filter: function (filename) {
if (filename.match(/node_modules/)) {
return false;
Expand Down Expand Up @@ -164,7 +165,8 @@ module.exports = function(options) {
if (config.livereload.enable) {
var watchOptions = {
ignoreDotFiles: true,
filter: config.livereload.filter
filter: config.livereload.filter,
interval: config.livereload.pollingInterval
};
watch.watchTree(file.path, watchOptions, function (filename) {
lrServer.changed({
Expand Down