fix ResolveOptions.plugins types

closes #10073
This commit is contained in:
opl- 2019-12-05 19:06:50 +01:00
parent 157c457241
commit 22569ce792
2 changed files with 36 additions and 13 deletions

View File

@ -230,6 +230,11 @@ export type RuleSetLoaderOptions =
* via the `definition` "ArrayOfStringOrStringArrayValues".
*/
export type ArrayOfStringOrStringArrayValues = (string | string[])[];
/**
* This interface was referenced by `WebpackOptions`'s JSON-Schema
* via the `definition` "RuleSetRules".
*/
export type RuleSetRules = RuleSetRule[];
/**
* Function acting as plugin
*
@ -240,11 +245,6 @@ export type WebpackPluginFunction = (
this: import("../lib/Compiler"),
compiler: import("../lib/Compiler")
) => void;
/**
* This interface was referenced by `WebpackOptions`'s JSON-Schema
* via the `definition` "RuleSetRules".
*/
export type RuleSetRules = RuleSetRule[];
/**
* This interface was referenced by `WebpackOptions`'s JSON-Schema
* via the `definition` "OptimizationSplitChunksGetCacheGroups".
@ -811,7 +811,7 @@ export interface ResolveOptions {
/**
* Plugins for the resolver
*/
plugins?: (WebpackPluginInstance | WebpackPluginFunction)[];
plugins?: ResolvePluginInstance[];
/**
* Custom resolver
*/
@ -839,13 +839,13 @@ export interface ResolveOptions {
* Plugin instance
*
* This interface was referenced by `WebpackOptions`'s JSON-Schema
* via the `definition` "WebpackPluginInstance".
* via the `definition` "ResolvePluginInstance".
*/
export interface WebpackPluginInstance {
export interface ResolvePluginInstance {
/**
* The run point of the plugin, required method.
*/
apply: (compiler: import("../lib/Compiler")) => void;
apply: (resolver: import("enhanced-resolve/lib/Resolver")) => void;
[k: string]: any;
}
/**
@ -972,6 +972,19 @@ export interface OptimizationOptions {
*/
usedExports?: boolean;
}
/**
* Plugin instance
*
* This interface was referenced by `WebpackOptions`'s JSON-Schema
* via the `definition` "WebpackPluginInstance".
*/
export interface WebpackPluginInstance {
/**
* The run point of the plugin, required method.
*/
apply: (compiler: import("../lib/Compiler")) => void;
[k: string]: any;
}
/**
* This interface was referenced by `WebpackOptions`'s JSON-Schema
* via the `definition` "OptimizationSplitChunksOptions".

View File

@ -1523,10 +1523,7 @@
"description": "Plugin of type object or instanceof Function",
"anyOf": [
{
"$ref": "#/definitions/WebpackPluginInstance"
},
{
"$ref": "#/definitions/WebpackPluginFunction"
"$ref": "#/definitions/ResolvePluginInstance"
}
]
}
@ -1556,6 +1553,19 @@
}
}
},
"ResolvePluginInstance": {
"description": "Plugin instance",
"type": "object",
"additionalProperties": true,
"properties": {
"apply": {
"description": "The run point of the plugin, required method.",
"instanceof": "Function",
"tsType": "(resolver: import('enhanced-resolve/lib/Resolver')) => void"
}
},
"required": ["apply"]
},
"RuleSetCondition": {
"anyOf": [
{