Skip to content

Commit

Permalink
🤖 Merge PR #47518 update(terser-webpack-plugin): minimizerOptions o…
Browse files Browse the repository at this point in the history
…ption by @peterblazejewicz

- `minimizerOptions` added
- test amended
- cleanup

webpack-contrib/terser-webpack-plugin#311

Thanks!
  • Loading branch information
peterblazejewicz committed Sep 15, 2020
1 parent 7aadebe commit 71edd17
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
5 changes: 2 additions & 3 deletions 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 <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
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

0 comments on commit 71edd17

Please sign in to comment.