Skip to content
This repository was archived by the owner on Jul 27, 2021. It is now read-only.

bugfix webpack4 tap 'failed' hook #66

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
4 changes: 4 additions & 0 deletions src/friendly-errors-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ class FriendlyErrorsWebpackPlugin {

compiler.hooks.done.tap(plugin, doneFn);
compiler.hooks.invalid.tap(plugin, invalidFn);
// when 'bail':true in webpack config, the compiler will tap 'failed' hook
compiler.hooks.failed && compiler.hooks.failed.tap(plugin, error => {
this.displayErrors([error], 'error');
})
} else {
compiler.plugin('done', doneFn);
compiler.plugin('invalid', invalidFn);
Expand Down