diff --git a/types/index.d.ts b/types/index.d.ts index 63cc74d..75ecad0 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -84,8 +84,8 @@ declare namespace Config { class Plugins extends TypedChainedMap> {} class Plugin extends ChainedMap implements Orderable { - init(value: (plugin: PluginClass, args: any[]) => PluginType): this; - use(plugin: PluginClass, args?: any[]): this; + init(value: (plugin: PluginType | PluginClass, args: any[]) => PluginType): this; + use(plugin: string | PluginType | PluginClass, args?: any[]): this; tap(f: (args: any[]) => any[]): this; // Orderable diff --git a/types/test/webpack-chain-tests.ts b/types/test/webpack-chain-tests.ts index 67b66a3..5678a37 100644 --- a/types/test/webpack-chain-tests.ts +++ b/types/test/webpack-chain-tests.ts @@ -185,10 +185,20 @@ config .after('bar') .end() + .plugin('asString') + .use('package-name-or-path') + .end() + + .plugin('asObject') + .use({ apply: (compiler: webpack.Compiler) => {}}) + .end() + .plugins .delete('foo') .delete('bar') .delete('baz') + .delete('asString') + .delete('asObject') .end() .node