From 894cbd4ef1fd86b3a74f465a455ea1ac336a4016 Mon Sep 17 00:00:00 2001 From: Roland Kaufmann Date: Sun, 28 May 2023 22:40:50 +0200 Subject: [PATCH] Fix checking if livereload option has been set Commit fd74513 removed the `this.` before the check for the livereload member, although that is the one that is set just a couple of lines above. I believe this must have been an editing error, because now the server dies with an error if the livereload options is not set. --- lib/index.cjs.js | 2 +- lib/index.esm.js | 2 +- src/index.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/index.cjs.js b/lib/index.cjs.js index e4ece6a..5f3d4ee 100644 --- a/lib/index.cjs.js +++ b/lib/index.cjs.js @@ -219,7 +219,7 @@ function DevServer(opts) { this.livereload = createLiveReloadOptions(opts.livereload); let livereloadMiddleware = null; - if (livereload$1) { + if (this.livereload) { const _opts = { host: this.host, protocol: this.protocol, errorProvider: this }; const src = this.livereload.src; const port = this.livereload.port; diff --git a/lib/index.esm.js b/lib/index.esm.js index 54994ea..a93fa33 100644 --- a/lib/index.esm.js +++ b/lib/index.esm.js @@ -215,7 +215,7 @@ function DevServer(opts) { this.livereload = createLiveReloadOptions(opts.livereload); let livereloadMiddleware = null; - if (livereload$1) { + if (this.livereload) { const _opts = { host: this.host, protocol: this.protocol, errorProvider: this }; const src = this.livereload.src; const port = this.livereload.port; diff --git a/src/index.js b/src/index.js index 8e58616..72f160b 100644 --- a/src/index.js +++ b/src/index.js @@ -96,7 +96,7 @@ function DevServer(opts) { this.livereload = createLiveReloadOptions(opts.livereload); let livereloadMiddleware = null; - if (livereload) { + if (this.livereload) { const _opts = { host: this.host, protocol: this.protocol, errorProvider: this }; const src = this.livereload.src; const port = this.livereload.port;