A try to explain the replace statement

This commit is contained in:
Jan Nicklas 2015-09-18 13:29:48 +02:00 committed by Jan Nicklas
parent 71dfeab599
commit eed82ed886
1 changed files with 2 additions and 1 deletions

View File

@ -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