mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
hot-reloader: return when rejected (#689)
This commit is contained in:
parent
c6842629ba
commit
0c82d8a483
|
@ -26,7 +26,7 @@ export default class HotReloader {
|
||||||
for (const fn of this.middlewares) {
|
for (const fn of this.middlewares) {
|
||||||
await new Promise((resolve, reject) => {
|
await new Promise((resolve, reject) => {
|
||||||
fn(req, res, (err) => {
|
fn(req, res, (err) => {
|
||||||
if (err) reject(err)
|
if (err) return reject(err)
|
||||||
resolve()
|
resolve()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
@ -47,7 +47,7 @@ export default class HotReloader {
|
||||||
if (this.webpackDevMiddleware) {
|
if (this.webpackDevMiddleware) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
this.webpackDevMiddleware.close((err) => {
|
this.webpackDevMiddleware.close((err) => {
|
||||||
if (err) reject(err)
|
if (err) return reject(err)
|
||||||
resolve()
|
resolve()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue