From a91e6fa0dbdc1c336c497a94c78d386ca21fcd01 Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Sat, 24 Mar 2018 12:22:49 +0430 Subject: [PATCH] fix(builder): graceful unwatch when devMiddleware is not initialized --- lib/builder/builder.mjs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/builder/builder.mjs b/lib/builder/builder.mjs index e64d86ae46..c0a327b039 100644 --- a/lib/builder/builder.mjs +++ b/lib/builder/builder.mjs @@ -648,7 +648,9 @@ export default class Builder { this.compilersWatching.forEach(watching => watching.close()) // Stop webpack middleware - await this.webpackDevMiddleware.close() + if (this.webpackDevMiddleware) { + await this.webpackDevMiddleware.close() + } } // TODO: remove ignore when generateConfig enabled again