Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1307,7 +1307,9 @@ class HtmlWebpackPlugin {

if ("error" in templateResult) {
compilation.errors.push(
prettyError(templateResult.error, compiler.context).toString(),
new Error(
prettyError(templateResult.error, compiler.context).toString(),
),
);
}

Expand Down Expand Up @@ -1497,7 +1499,9 @@ class HtmlWebpackPlugin {
.catch((err) => {
// In case anything went wrong the promise is resolved
// with the error message and an error is logged
compilation.errors.push(prettyError(err, compiler.context).toString());
compilation.errors.push(
new Error(prettyError(err, compiler.context).toString()),
);
return this.options.showErrors
? prettyError(err, compiler.context).toHtml()
: "ERROR";
Expand Down
Loading