diff --git a/declarations/WebpackOptions.d.ts b/declarations/WebpackOptions.d.ts index b2a4c7a12..3ae739c7e 100644 --- a/declarations/WebpackOptions.d.ts +++ b/declarations/WebpackOptions.d.ts @@ -2743,6 +2743,10 @@ export interface ExternalItemFunctionData { * Contextual information. */ contextInfo?: import("../lib/ModuleFactory").ModuleFactoryCreateDataContextInfo; + /** + * The category of the referencing dependencies. + */ + dependencyType?: string; /** * Get a resolve function with the current resolver options. */ diff --git a/lib/ExternalModuleFactoryPlugin.js b/lib/ExternalModuleFactoryPlugin.js index 0a89a3f59..cd1d8fd2e 100644 --- a/lib/ExternalModuleFactoryPlugin.js +++ b/lib/ExternalModuleFactoryPlugin.js @@ -172,13 +172,14 @@ class ExternalModuleFactoryPlugin { cb ); } else { + const dependencyType = dependency.category || ""; const promise = externals( { context, request: dependency.request, + dependencyType, contextInfo, getResolve: options => (context, request, callback) => { - const dependencyType = dependency.category || ""; const resolveContext = { fileDependencies: data.fileDependencies, missingDependencies: data.missingDependencies, diff --git a/schemas/WebpackOptions.json b/schemas/WebpackOptions.json index b45d2b2ae..7ab58062b 100644 --- a/schemas/WebpackOptions.json +++ b/schemas/WebpackOptions.json @@ -807,6 +807,10 @@ "type": "object", "tsType": "import('../lib/ModuleFactory').ModuleFactoryCreateDataContextInfo" }, + "dependencyType": { + "description": "The category of the referencing dependencies.", + "type": "string" + }, "getResolve": { "description": "Get a resolve function with the current resolver options.", "instanceof": "Function", diff --git a/types.d.ts b/types.d.ts index e630d8434..457be1063 100644 --- a/types.d.ts +++ b/types.d.ts @@ -3617,6 +3617,11 @@ declare interface ExternalItemFunctionData { */ contextInfo?: ModuleFactoryCreateDataContextInfo; + /** + * The category of the referencing dependencies. + */ + dependencyType?: string; + /** * Get a resolve function with the current resolver options. */