diff --git a/declarations/WebpackOptions.d.ts b/declarations/WebpackOptions.d.ts index 97c71775c..8323c7358 100644 --- a/declarations/WebpackOptions.d.ts +++ b/declarations/WebpackOptions.d.ts @@ -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". diff --git a/schemas/WebpackOptions.json b/schemas/WebpackOptions.json index 4a099c0e4..29c8c2b5a 100644 --- a/schemas/WebpackOptions.json +++ b/schemas/WebpackOptions.json @@ -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": [ {