Skip to content

Commit

Permalink
Remove obsolete check in dev-server (#5320)
Browse files Browse the repository at this point in the history
Remove `if(this.hotReloader)` as it's always guaranteed to be there.

#5317 (comment)
  • Loading branch information
timneutkens authored Sep 28, 2018
1 parent 881e542 commit 7f39aef
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions server/next-dev-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,17 @@ export default class DevServer extends Server {

async prepare () {
await super.prepare()
if (this.hotReloader) {
await this.hotReloader.start()
}
await this.hotReloader.start()
}

async close () {
if (this.hotReloader) {
await this.hotReloader.stop()
}
await this.hotReloader.stop()
}

async run (req, res, parsedUrl) {
if (this.hotReloader) {
const {finished} = await this.hotReloader.run(req, res, parsedUrl)
if (finished) {
return
}
const {finished} = await this.hotReloader.run(req, res, parsedUrl)
if (finished) {
return
}

return super.run(req, res, parsedUrl)
Expand Down Expand Up @@ -117,8 +111,6 @@ export default class DevServer extends Server {
}

async getCompilationError (page) {
if (!this.hotReloader) return

const errors = await this.hotReloader.getCompilationErrors(page)
if (errors.length === 0) return

Expand Down

0 comments on commit 7f39aef

Please sign in to comment.