Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update(terser-webpack-plugin): minimizerOptions option #47518

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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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