diff --git a/types/terser-webpack-plugin/index.d.ts b/types/terser-webpack-plugin/index.d.ts index fabfdd920588ec..e5cf729267bc7a 100644 --- a/types/terser-webpack-plugin/index.d.ts +++ b/types/terser-webpack-plugin/index.d.ts @@ -1,9 +1,8 @@ -// Type definitions for terser-webpack-plugin 4.1 +// Type definitions for terser-webpack-plugin 4.2 // Project: https://github.com/webpack-contrib/terser-webpack-plugin // Definitions by: Daniel Schopf // Piotr Błażejewicz // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 3.0 import { Plugin } from 'webpack'; import { MinifyOptions } from 'terser'; @@ -89,7 +88,7 @@ declare namespace TerserPlugin { * By default plugin uses terser package. Useful for using and testing unpublished versions or forks * @default undefined */ - minify?: (file: any, sourceMap: any) => MinifyResult; + minify?: (file: any, sourceMap: any, minimizerOptions?: MinifyOptions) => MinifyResult; /** * Terser minify {@link https://github.com/terser/terser#minify-options|options}. diff --git a/types/terser-webpack-plugin/terser-webpack-plugin-tests.ts b/types/terser-webpack-plugin/terser-webpack-plugin-tests.ts index 42e6ed942d99ae..dbc58c446ff685 100644 --- a/types/terser-webpack-plugin/terser-webpack-plugin-tests.ts +++ b/types/terser-webpack-plugin/terser-webpack-plugin-tests.ts @@ -47,7 +47,8 @@ const _ = webpack({ }), // minify new TerserPlugin({ - minify: (file, sourceMap) => { + minify: (file, sourceMap, minimizerOptions) => { + minimizerOptions!; // $ExpectType MinifyOptions const results: TerserPlugin.MinifyResult = { code: '', extractedComments: [''],