Movatterモバイル変換


[0]ホーム

URL:


webpack logo
ag grid
ag charts

ContextModuleFactory Hooks

TheContextModuleFactory module is used by theCompiler to generate dependencies from webpack specificrequire.context API. It resolves the requested directory, generates requests for each file and filters against passed regExp. Matching dependencies then passes throughNormalModuleFactory.

TheContextModuleFactory class extendsTapable and provides the followinglifecycle hooks. They can be tapped the same way as compiler hooks:

ContextModuleFactory.hooks.someHook.tap(/* ... */);

As with thecompiler,tapAsync andtapPromise may also be availabledepending on the type of hook.

beforeResolve

AsyncSeriesWaterfallHook

Called before resolving the requested directory. The request can be ignored by returningfalse.

  • Callback Parameters:data

afterResolve

AsyncSeriesWaterfallHook

Called after the requested directory resolved.

  • Callback Parameters:data

contextModuleFiles

SyncWaterfallHook

Called after directory contents are read. On recursive mode, calls for each sub-directory as well. Callback parameter is an array of all file and folder names in each directory.

  • Callback Parameters:fileNames

alternativeRequests

AsyncSeriesWaterfallHook

Called for each file after the request is created but before filtering against regExp.

  • Callback Parameters:requestoptions

1 Contributor

iguessitsokay

[8]ページ先頭

©2009-2025 Movatter.jp