From eed82ed8866b81344f6d8a47bf641e73a490be4b Mon Sep 17 00:00:00 2001 From: Jan Nicklas Date: Fri, 18 Sep 2015 13:29:48 +0200 Subject: [PATCH] A try to explain the replace statement --- index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 9c9f15f7..90bd2b71 100644 --- a/index.js +++ b/index.js @@ -186,7 +186,8 @@ HtmlWebpackPlugin.prototype.evaluateCompilationResult = function(compilation, co return Promise.reject('The child compilation didn\'t provide a result'); } var source = compilationResult.source(); - // Replace first matching result variable, so that only a function is left. + // The LibraryTemplatePlugin stores the template result in a local variable. + // To extract the result during the evaluation this part has to be removed. source = source.replace('var HTML_WEBPACK_PLUGIN_RESULT =', ''); // Evaluate code and cast to string