🤖 Merge PR #46664 update(terser-webpack-plugin): update to v4.1 by @peterblazejewicz

- limit types of props returned with result, this is actually 4.0
public API change:
https://github.com/webpack-contrib/terser-webpack-plugin/compare/v3.1.0...v4.0.0

- tests updated
- minor version bump

Thanks!
This commit is contained in:
Piotr Błażejewicz (Peter Blazejewicz) 2020-08-11 10:08:41 +02:00 committed by GitHub
parent 9d055f00a1
commit db841e9f31
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 5 deletions

View File

@ -1,4 +1,4 @@
// Type definitions for terser-webpack-plugin 4.0
// Type definitions for terser-webpack-plugin 4.1
// 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>
@ -13,10 +13,8 @@ import { MinifyOptions } from 'terser';
*/
declare namespace TerserPlugin {
interface MinifyResult {
error: any;
map: any;
code: any;
warnings: any;
extractedComments: any;
}

View File

@ -50,10 +50,8 @@ const _ = webpack({
minify: (file, sourceMap) => {
const results: TerserPlugin.MinifyResult = {
code: '',
error: '',
extractedComments: [''],
map: '',
warnings: [''],
};
return results;
},
@ -129,6 +127,22 @@ const _ = webpack({
},
extractComments: false,
}),
new TerserPlugin({
terserOptions: {
ecma: undefined,
parse: {},
compress: {},
mangle: true, // Note `mangle.properties` is `false` by default.
module: false,
output: undefined,
toplevel: false,
nameCache: undefined,
ie8: false,
keep_classnames: undefined,
keep_fnames: false,
safari10: false,
},
}),
],
},
});