MCPcopy
hub / github.com/webpack/webpack / interceptHook

Method interceptHook

lib/ProgressPlugin.js:712–739  ·  view source on GitHub ↗
(hook, progress, category, name)

Source from the content-addressed store, hash-verified

710 * @param {string} name name
711 */
712 const interceptHook = (hook, progress, category, name) => {
713 hook.intercept({
714 name: PLUGIN_NAME,
715 call() {
716 handler(progress, category, name);
717 },
718 done() {
719 progressReporters.set(compiler, undefined);
720 handler(progress, category, name);
721 },
722 result() {
723 handler(progress, category, name);
724 },
725 error() {
726 handler(progress, category, name);
727 },
728 /**
729 * Processes the provided tap.
730 * @param {Tap} tap tap
731 */
732 tap(tap) {
733 progressReporters.set(compiler, (p, ...args) => {
734 handler(progress, category, name, tap.name, ...args);
735 });
736 handler(progress, category, name, tap.name);
737 }
738 });
739 };
740 compiler.cache.hooks.endIdle.intercept({
741 name: PLUGIN_NAME,
742 call() {

Callers

nothing calls this directly

Calls 1

interceptMethod · 0.80

Tested by

no test coverage detected