File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change 1
1
"use strict" ;
2
2
3
+ /** @typedef {import("./Compiler") } Compiler */
4
+ /** @typedef {import("./ContextModuleFactory") } ContextModuleFactory */
5
+
3
6
class ContextExclusionPlugin {
7
+ /**
8
+ * @param {RegExp } negativeMatcher Matcher regular expression
9
+ */
4
10
constructor ( negativeMatcher ) {
5
11
this . negativeMatcher = negativeMatcher ;
6
12
}
7
13
14
+ /**
15
+ * Apply the plugin
16
+ * @param {Compiler } compiler Webpack Compiler
17
+ * @returns {void }
18
+ */
8
19
apply ( compiler ) {
9
20
compiler . hooks . contextModuleFactory . tap ( "ContextExclusionPlugin" , cmf => {
10
21
cmf . hooks . contextModuleFiles . tap ( "ContextExclusionPlugin" , files => {
Original file line number Diff line number Diff line change @@ -15,15 +15,21 @@ const {
15
15
const ContextModule = require ( "./ContextModule" ) ;
16
16
const ContextElementDependency = require ( "./dependencies/ContextElementDependency" ) ;
17
17
18
+ /** @typedef {import("./Module") } Module */
19
+
18
20
const EMPTY_RESOLVE_OPTIONS = { } ;
19
21
20
22
module . exports = class ContextModuleFactory extends Tapable {
21
23
constructor ( resolverFactory ) {
22
24
super ( ) ;
23
25
this . hooks = {
26
+ /** @type {AsyncSeriesWaterfallHook<TODO> } */
24
27
beforeResolve : new AsyncSeriesWaterfallHook ( [ "data" ] ) ,
28
+ /** @type {AsyncSeriesWaterfallHook<TODO> } */
25
29
afterResolve : new AsyncSeriesWaterfallHook ( [ "data" ] ) ,
30
+ /** @type {SyncWaterfallHook<string[]> } */
26
31
contextModuleFiles : new SyncWaterfallHook ( [ "files" ] ) ,
32
+ /** @type {SyncWaterfallHook<TODO[]> } */
27
33
alternatives : new AsyncSeriesWaterfallHook ( [ "modules" ] )
28
34
} ;
29
35
this . _pluginCompat . tap ( "ContextModuleFactory" , options => {
You can’t perform that action at this time.
0 commit comments