Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions types/terser-webpack-plugin/index.d.ts
Original file line number Diff line number Diff line change
@@ -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 <https://github.com/Danscho>
// Piotr Błażejewicz <https://github.com/peterblazejewicz>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 3.0

import { Plugin } from 'webpack';
import { MinifyOptions } from 'terser';
Expand Down Expand Up @@ -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}.
Expand Down
3 changes: 2 additions & 1 deletion types/terser-webpack-plugin/terser-webpack-plugin-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: [''],
Expand Down