Skip to content

Commit

Permalink
A try to explain the replace statement
Browse files Browse the repository at this point in the history
  • Loading branch information
jantimon authored and Jan Nicklas committed Sep 18, 2015
1 parent 71dfeab commit eed82ed
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit eed82ed

Please sign in to comment.