Skip to content

Commit

Permalink
feat: add poll-interval option to pass through to supervisor; fixes a…
Browse files Browse the repository at this point in the history
  • Loading branch information
mojoaxel committed Dec 2, 2018
1 parent af19fc1 commit e7b2f80
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ Options:
-e, --exts [extensions] Extensions separated by commas or pipes. Defaults to html,js,css.
-p, --port [port] The port to bind to. Can be set with PORT env variable as well. Defaults to 8080
-s, --start-page [start-page] Specify a start page. Defaults to index.html
-i, --poll-interval [interval] How often to poll watched files for changes. Defaults to Node default.
-v, --verbose [verbose] Turning on logging on the server and client side. Defaults to false
```
Expand Down
3 changes: 2 additions & 1 deletion bin/reload
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ program.version(require('../package.json').version)
.option('-p, --port [port]', 'The port to bind to. Can be set with PORT env variable as well. Defaults to 8080', '8080')
.option('-s, --start-page [start-page]', 'Specify a start page. Defaults to index.html', 'index.html')
.option('-f, --fallback [fallback]', 'Fallback to the start page when route is not found')
.option('-i, --poll-interval [milliseconds]', 'How often to poll watched files for changes. Defaults to Node default.', null)
.option('-v, --verbose [verbose]', 'Turning on logging on the server and client side. Defaults to false', false)
.parse(process.argv)

Expand All @@ -30,7 +31,7 @@ if (typeof program.watchDir === 'undefined') {
program.watchDir = program.dir
}

var args = ['-e', program.exts, '-w', program.watchDir, '-q', '--', serverFile, program.port, program.dir, !!program.browser, program.hostname, runFile, program.startPage, program.fallback, program.verbose]
var args = ['-e', program.exts, '-w', program.watchDir, (program.pollInterval ? '-p' + program.pollInterval : ''), '-q', '--', serverFile, program.port, program.dir, !!program.browser, program.hostname, runFile, program.startPage, program.fallback, program.verbose]
supervisor.run(args)

console.log('\nReload web server:')
Expand Down

0 comments on commit e7b2f80

Please sign in to comment.