MCPcopy
hub / github.com/webpack/webpack / interceptAllGeneratorHooks

Function interceptAllGeneratorHooks

lib/debug/ProfilingPlugin.js:445–460  ·  view source on GitHub ↗
(moduleFactory, tracer)

Source from the content-addressed store, hash-verified

443 * @param {Trace} tracer tracer
444 */
445const interceptAllGeneratorHooks = (moduleFactory, tracer) => {
446 const moduleTypes = [
447 ...JAVASCRIPT_MODULES,
448 JSON_MODULE_TYPE,
449 ...WEBASSEMBLY_MODULES,
450 ...CSS_MODULES
451 ];
452
453 for (const moduleType of moduleTypes) {
454 moduleFactory.hooks.generator
455 .for(moduleType)
456 .tap(PLUGIN_NAME, (parser, _parserOpts) => {
457 interceptAllHooksFor(parser, tracer, "Generator");
458 });
459 }
460};
461
462/**
463 * Intercept all javascript modules plugin hooks.

Callers 1

applyMethod · 0.85

Calls 2

interceptAllHooksForFunction · 0.85
tapMethod · 0.80

Tested by

no test coverage detected