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

View File

@ -1523,10 +1523,7 @@
"description": "Plugin of type object or instanceof Function", "description": "Plugin of type object or instanceof Function",
"anyOf": [ "anyOf": [
{ {
"$ref": "#/definitions/WebpackPluginInstance" "$ref": "#/definitions/ResolvePluginInstance"
},
{
"$ref": "#/definitions/WebpackPluginFunction"
} }
] ]
} }
@ -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": { "RuleSetCondition": {
"anyOf": [ "anyOf": [
{ {