A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://webpack.js.org/api/normalmodulefactory-hooks below:

NormalModuleFactory Hooks | webpack

NormalModuleFactory Hooks

The NormalModuleFactory module is used by the Compiler to generate modules. Starting with entry points, it resolves each request, parses the content to find further requests, and keeps crawling through files by resolving all and parsing any new files. At last stage, each dependency becomes a Module instance.

The NormalModuleFactory class extends Tapable and provides the following lifecycle hooks. They can be tapped the same way as compiler hooks:

NormalModuleFactory.hooks.someHook.tap();

NormaleModuleFactory creates Parser and Generator instances which can be accessed by HookMaps. Identifier must be passed to tap into these:

NormalModuleFactory.hooks.someHook.for('identifier').tap();

As with the compiler, tapAsync and tapPromise may also be available depending on the type of hook.

beforeResolve

AsyncSeriesBailHook

Called when a new dependency request is encountered. A dependency can be ignored by returning false. Otherwise, it should return undefined to proceed.

factorize

AsyncSeriesBailHook

Called before initiating resolve. It should return undefined to proceed.

resolve

AsyncSeriesBailHook

Called before the request is resolved. A dependency can be ignored by returning false. Returning a Module instance would finalize the process. Otherwise, it should return undefined to proceed.

resolveForScheme

AsyncSeriesBailHook

Called before a request with scheme (URI) is resolved.

afterResolve

AsyncSeriesBailHook

Called after the request is resolved.

createModule

AsyncSeriesBailHook

Called before a NormalModule instance is created.

createModuleClass

HookMap<SyncBailHook>

5.81.0+

A hook that allows you to override the NormalModule class when creating modules. This hook is called after the createModule hook and before the module hook.

module

SyncWaterfallHook

Called after a NormalModule instance is created.

createParser

HookMap<SyncBailHook>

Called before a Parser instance is created. parserOptions is options in module.parser for the corresponding identifier or an empty object.

parser

HookMap<SyncHook>

Fired after a Parser instance is created.

Possible default identifiers:

  1. javascript/auto
  2. javascript/dynamic
  3. javascript/esm
  4. json
  5. webassembly/sync
  6. webassembly/async
  7. asset
createGenerator

HookMap<SyncBailHook>

Called before a Generator instance is created. generatorOptions is options in module.parser for the corresponding identifier or an empty object.

generator

HookMap<SyncHook>

Called after a Generator instance is created.

Possible default identifiers:

  1. json
  2. webassembly/sync
  3. webassembly/async
  4. asset
  5. asset/source
  6. asset/resource
  7. asset/inline

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4