From 7e4f83b26c4e1b8853098f048df61e16b7d2736d Mon Sep 17 00:00:00 2001 From: Jan Nicklas Date: Mon, 11 Jan 2016 11:40:50 +0100 Subject: [PATCH] Fixes #130 --- index.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index b8bc50f..4a11cf0 100644 --- a/index.js +++ b/index.js @@ -144,10 +144,18 @@ HtmlWebpackPlugin.prototype.apply = function(compiler) { }) .then(function(){ // Let other plugins know that we are done: - compilation.applyPluginsAsyncWaterfall('html-webpack-plugin-after-emit', { + return applyPluginsAsyncWaterfall('html-webpack-plugin-after-emit', { html: compilation.assets[self.options.filename], plugin: self - }, callback); + }); + }) + // Let webpack continue with it + .finally(function(){ + callback(); + // Tell blue bird that we don't want to wait for callback. + // Fixes "Warning: a promise was created in a handler but none were returned from it" + // https://github.com/petkaantonov/bluebird/blob/master/docs/docs/warning-explanations.md#warning-a-promise-was-created-in-a-handler-but-none-were-returned-from-it + return null; }); }); };