MCPcopy
hub / github.com/webpack/webpack / interceptAllParserHooks

Function interceptAllParserHooks

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

Source from the content-addressed store, hash-verified

421 * @param {Trace} tracer tracer
422 */
423const interceptAllParserHooks = (moduleFactory, tracer) => {
424 const moduleTypes = [
425 ...JAVASCRIPT_MODULES,
426 JSON_MODULE_TYPE,
427 ...WEBASSEMBLY_MODULES,
428 ...CSS_MODULES
429 ];
430
431 for (const moduleType of moduleTypes) {
432 moduleFactory.hooks.parser
433 .for(moduleType)
434 .tap(PLUGIN_NAME, (parser, _parserOpts) => {
435 interceptAllHooksFor(parser, tracer, "Parser");
436 });
437 }
438};
439
440/**
441 * Intercept all generator hooks.

Callers 1

applyMethod · 0.85

Calls 2

interceptAllHooksForFunction · 0.85
tapMethod · 0.80

Tested by

no test coverage detected