Skip to content

Commit c3f2fdc

Browse files
committed
feat: Allow to use console.log inside templates
1 parent 8359c69 commit c3f2fdc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ class HtmlWebpackPlugin {
306306
// To extract the result during the evaluation this part has to be removed.
307307
source = source.replace('var HTML_WEBPACK_PLUGIN_RESULT =', '');
308308
const template = this.options.template.replace(/^.+!/, '').replace(/\?.+$/, '');
309-
const vmContext = vm.createContext(_.extend({ HTML_WEBPACK_PLUGIN: true, require: require }, global));
309+
const vmContext = vm.createContext(_.extend({ HTML_WEBPACK_PLUGIN: true, require: require, console: console }, global));
310310
const vmScript = new vm.Script(source, { filename: template });
311311
// Evaluate code and cast to string
312312
let newSource;

0 commit comments

Comments
 (0)