From 0c522a4deabe6a5cdef792572d8dc911cab14e2b Mon Sep 17 00:00:00 2001 From: Robert Long <robert@robertlong.me> Date: Thu, 7 Dec 2017 15:49:04 -0800 Subject: [PATCH] Build system race condition patch --- templates/HandlebarsTemplatePlugin.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/templates/HandlebarsTemplatePlugin.js b/templates/HandlebarsTemplatePlugin.js index 5c4278da3..b7fd87f01 100644 --- a/templates/HandlebarsTemplatePlugin.js +++ b/templates/HandlebarsTemplatePlugin.js @@ -36,8 +36,12 @@ class HandlebarsTemplatePlugin { }); // Compile templates on each webpack compilation - compiler.plugin("emit", (compilation, callback) => { - this.compileTemplates(compiler, compilation).then(callback); + compiler.plugin("after-emit", (compilation, callback) => { + this.compileTemplates(compiler, compilation) + .then(callback) + .catch(err => { + compilation.errors.push(err); + }); }); } -- GitLab