1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00

Remove obsolete check in dev-server (#5320)

Remove `if(this.hotReloader)` as it's always guaranteed to be there.

https://github.com/zeit/next.js/pull/5317#discussion_r221233064
This commit is contained in:
Tim Neutkens 2018-09-28 14:32:26 +02:00 committed by GitHub
parent 881e5426e5
commit 7f39aef912
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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)
@ -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