@@ -7251,6 +7251,37 @@ declare interface ModuleReferenceOptions {
72517251 */
72527252 asiSafe ?: boolean ;
72537253}
7254+ declare interface ModuleSettings {
7255+ /**
7256+ * Specifies the layer in which the module should be placed in.
7257+ */
7258+ layer ?: string ;
7259+
7260+ /**
7261+ * Module type to use for the module.
7262+ */
7263+ type ?: string ;
7264+
7265+ /**
7266+ * Options for the resolver.
7267+ */
7268+ resolve ?: ResolveOptionsWebpackOptions ;
7269+
7270+ /**
7271+ * Options for parsing.
7272+ */
7273+ parser ?: { [ index : string ] : any } ;
7274+
7275+ /**
7276+ * The options for the module generator.
7277+ */
7278+ generator ?: { [ index : string ] : any } ;
7279+
7280+ /**
7281+ * Flags a module as with or without side effects.
7282+ */
7283+ sideEffects ?: boolean ;
7284+ }
72547285declare abstract class ModuleTemplate {
72557286 type : string ;
72567287 hooks : Readonly < {
@@ -7502,76 +7533,15 @@ declare class NodeTemplatePlugin {
75027533}
75037534type NodeWebpackOptions = false | NodeOptions ;
75047535declare class NormalModule extends Module {
7505- constructor ( __0 : {
7506- /**
7507- * an optional layer in which the module is
7508- */
7509- layer ?: string ;
7510- /**
7511- * module type
7512- */
7513- type : string ;
7514- /**
7515- * request string
7516- */
7517- request : string ;
7518- /**
7519- * request intended by user (without loaders from config)
7520- */
7521- userRequest : string ;
7522- /**
7523- * request without resolving
7524- */
7525- rawRequest : string ;
7526- /**
7527- * list of loaders
7528- */
7529- loaders : LoaderItem [ ] ;
7530- /**
7531- * path + query of the real resource
7532- */
7533- resource : string ;
7534- /**
7535- * resource resolve data
7536- */
7537- resourceResolveData ?: Record < string , any > ;
7538- /**
7539- * context directory for resolving
7540- */
7541- context : string ;
7542- /**
7543- * path + query of the matched resource (virtual)
7544- */
7545- matchResource ?: string ;
7546- /**
7547- * the parser used
7548- */
7549- parser : Parser ;
7550- /**
7551- * the options of the parser used
7552- */
7553- parserOptions : object ;
7554- /**
7555- * the generator used
7556- */
7557- generator : Generator ;
7558- /**
7559- * the options of the generator used
7560- */
7561- generatorOptions : object ;
7562- /**
7563- * options used for resolving requests from this module
7564- */
7565- resolveOptions : Object ;
7566- } ) ;
7536+ constructor ( __0 : NormalModuleCreateData ) ;
75677537 request : string ;
75687538 userRequest : string ;
75697539 rawRequest : string ;
75707540 binary : boolean ;
75717541 parser : Parser ;
7572- parserOptions : object ;
7542+ parserOptions ?: Record < string , any > ;
75737543 generator : Generator ;
7574- generatorOptions : object ;
7544+ generatorOptions ?: Record < string , any > ;
75757545 resource : string ;
75767546 resourceResolveData ?: Record < string , any > ;
75777547 matchResource ?: string ;
@@ -7614,20 +7584,109 @@ declare interface NormalModuleCompilationHooks {
76147584 readResource : HookMap < AsyncSeriesBailHook < [ object ] , string | Buffer > > ;
76157585 needBuild : AsyncSeriesBailHook < [ NormalModule , NeedBuildContext ] , boolean > ;
76167586}
7587+ declare interface NormalModuleCreateData {
7588+ /**
7589+ * an optional layer in which the module is
7590+ */
7591+ layer ?: string ;
7592+
7593+ /**
7594+ * module type
7595+ */
7596+ type : string ;
7597+
7598+ /**
7599+ * request string
7600+ */
7601+ request : string ;
7602+
7603+ /**
7604+ * request intended by user (without loaders from config)
7605+ */
7606+ userRequest : string ;
7607+
7608+ /**
7609+ * request without resolving
7610+ */
7611+ rawRequest : string ;
7612+
7613+ /**
7614+ * list of loaders
7615+ */
7616+ loaders : LoaderItem [ ] ;
7617+
7618+ /**
7619+ * path + query of the real resource
7620+ */
7621+ resource : string ;
7622+
7623+ /**
7624+ * resource resolve data
7625+ */
7626+ resourceResolveData ?: Record < string , any > ;
7627+
7628+ /**
7629+ * context directory for resolving
7630+ */
7631+ context : string ;
7632+
7633+ /**
7634+ * path + query of the matched resource (virtual)
7635+ */
7636+ matchResource ?: string ;
7637+
7638+ /**
7639+ * the parser used
7640+ */
7641+ parser : Parser ;
7642+
7643+ /**
7644+ * the options of the parser used
7645+ */
7646+ parserOptions ?: Record < string , any > ;
7647+
7648+ /**
7649+ * the generator used
7650+ */
7651+ generator : Generator ;
7652+
7653+ /**
7654+ * the options of the generator used
7655+ */
7656+ generatorOptions ?: Record < string , any > ;
7657+
7658+ /**
7659+ * options used for resolving requests from this module
7660+ */
7661+ resolveOptions ?: ResolveOptionsWebpackOptions ;
7662+ }
76177663declare abstract class NormalModuleFactory extends ModuleFactory {
76187664 hooks : Readonly < {
7619- resolve : AsyncSeriesBailHook < [ ResolveData ] , any > ;
7665+ resolve : AsyncSeriesBailHook < [ ResolveData ] , false | void | Module > ;
76207666 resolveForScheme : HookMap <
76217667 AsyncSeriesBailHook < [ ResourceDataWithData , ResolveData ] , true | void >
76227668 > ;
76237669 resolveInScheme : HookMap <
76247670 AsyncSeriesBailHook < [ ResourceDataWithData , ResolveData ] , true | void >
76257671 > ;
7626- factorize : AsyncSeriesBailHook < [ ResolveData ] , any > ;
7627- beforeResolve : AsyncSeriesBailHook < [ ResolveData ] , any > ;
7628- afterResolve : AsyncSeriesBailHook < [ ResolveData ] , any > ;
7629- createModule : AsyncSeriesBailHook < [ Object , ResolveData ] , any > ;
7630- module : SyncWaterfallHook < [ Module , Object , ResolveData ] , any > ;
7672+ factorize : AsyncSeriesBailHook < [ ResolveData ] , Module > ;
7673+ beforeResolve : AsyncSeriesBailHook < [ ResolveData ] , false | void > ;
7674+ afterResolve : AsyncSeriesBailHook < [ ResolveData ] , false | void > ;
7675+ createModule : AsyncSeriesBailHook <
7676+ [
7677+ Partial < NormalModuleCreateData & { settings : ModuleSettings } > ,
7678+ ResolveData
7679+ ] ,
7680+ void | Module
7681+ > ;
7682+ module : SyncWaterfallHook <
7683+ [
7684+ Module ,
7685+ Partial < NormalModuleCreateData & { settings : ModuleSettings } > ,
7686+ ResolveData
7687+ ] ,
7688+ Module
7689+ > ;
76317690 createParser : HookMap < SyncBailHook < any , any > > ;
76327691 parser : HookMap < SyncHook < any > > ;
76337692 createGenerator : HookMap < SyncBailHook < any , any > > ;
@@ -9429,7 +9488,7 @@ declare interface ResolveData {
94299488 assertions ?: Record < string , any > ;
94309489 dependencies : ModuleDependency [ ] ;
94319490 dependencyType : string ;
9432- createData : Object ;
9491+ createData : Partial < NormalModuleCreateData & { settings : ModuleSettings } > ;
94339492 fileDependencies : LazySet < string > ;
94349493 missingDependencies : LazySet < string > ;
94359494 contextDependencies : LazySet < string > ;
0 commit comments