mirror of https://github.com/webpack/webpack.git
add dependencyType to externals function data
This commit is contained in:
parent
629f9f031c
commit
35a399e81a
|
@ -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.
|
||||
*/
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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.
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue