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:
parent
881e5426e5
commit
7f39aef912
|
@ -21,23 +21,17 @@ export default class DevServer extends Server {
|
||||||
|
|
||||||
async prepare () {
|
async prepare () {
|
||||||
await super.prepare()
|
await super.prepare()
|
||||||
if (this.hotReloader) {
|
await this.hotReloader.start()
|
||||||
await this.hotReloader.start()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async close () {
|
async close () {
|
||||||
if (this.hotReloader) {
|
await this.hotReloader.stop()
|
||||||
await this.hotReloader.stop()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async run (req, res, parsedUrl) {
|
async run (req, res, parsedUrl) {
|
||||||
if (this.hotReloader) {
|
const {finished} = await this.hotReloader.run(req, res, parsedUrl)
|
||||||
const {finished} = await this.hotReloader.run(req, res, parsedUrl)
|
if (finished) {
|
||||||
if (finished) {
|
return
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return super.run(req, res, parsedUrl)
|
return super.run(req, res, parsedUrl)
|
||||||
|
@ -117,8 +111,6 @@ export default class DevServer extends Server {
|
||||||
}
|
}
|
||||||
|
|
||||||
async getCompilationError (page) {
|
async getCompilationError (page) {
|
||||||
if (!this.hotReloader) return
|
|
||||||
|
|
||||||
const errors = await this.hotReloader.getCompilationErrors(page)
|
const errors = await this.hotReloader.getCompilationErrors(page)
|
||||||
if (errors.length === 0) return
|
if (errors.length === 0) return
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue