diff --git a/types/uglify-js/index.d.ts b/types/uglify-js/index.d.ts index cab53cb4db..eca756bd53 100644 --- a/types/uglify-js/index.d.ts +++ b/types/uglify-js/index.d.ts @@ -10,7 +10,7 @@ export interface ParseOptions { bare_returns?: boolean; html5_comments?: boolean; /** Support `#!command` as the first line */ - shebang: boolean; + shebang?: boolean; } export interface CompressOptions { @@ -198,6 +198,7 @@ export interface MinifyOptions { export interface MinifyOutput { error?: Error; + warnings?: string[]; code: string; map: string; } diff --git a/types/uglify-js/uglify-js-tests.ts b/types/uglify-js/uglify-js-tests.ts index 6b146ab0e7..19c11dfdf1 100644 --- a/types/uglify-js/uglify-js-tests.ts +++ b/types/uglify-js/uglify-js-tests.ts @@ -20,7 +20,7 @@ minify(code, { } }); -minify(code, { +const output = minify(code, { warnings: 'verbose', mangle: { properties: { @@ -34,3 +34,7 @@ minify(code, { arguments: true } }); + +if (output.warnings) { + output.warnings.filter(x => x === 'Dropping unused variable'); +}