From e7b2f804bbb860bf5c91b4fce437cfcbc6c9157b Mon Sep 17 00:00:00 2001 From: Alexander Wunschik Date: Sun, 2 Dec 2018 23:22:38 +0100 Subject: [PATCH] feat: add poll-interval option to pass through to supervisor; fixes #168 --- README.md | 1 + bin/reload | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f416a1a..4570c47 100644 --- a/README.md +++ b/README.md @@ -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 ``` diff --git a/bin/reload b/bin/reload index c05b684..1c818bd 100755 --- a/bin/reload +++ b/bin/reload @@ -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) @@ -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:')