Allow specific mangle options to be passed to gulp-uglify, fix incorrectly narrow type in uglify-js (#28085)

* Allow specific mangle options to be passed to gulp-uglify

* Set required TS version

* Update uglify-js v2 too

* Fix tests
This commit is contained in:
Liam McLoughlin 2018-10-15 17:58:40 +01:00 committed by Sheetal Nandi
parent 36aa210efd
commit dfd2e2fcc2
10 changed files with 13 additions and 25 deletions

View File

@ -2,6 +2,7 @@
// Project: https://github.com/sindresorhus/gulp-filter
// Definitions by: Tanguy Krotoff <https://github.com/tkrotoff>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
/// <reference types="node" />

View File

@ -14,10 +14,7 @@
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true,
"paths": {
"uglify-js": ["uglify-js/v2"]
}
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",

View File

@ -2,6 +2,7 @@
// Project: https://github.com/jamesknelson/gulp-rev-replace
// Definitions by: Tanguy Krotoff <https://github.com/tkrotoff>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
/// <reference types="node" />

View File

@ -14,12 +14,7 @@
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true,
"paths": {
"uglify-js": [
"uglify-js/v2"
]
}
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",

View File

@ -3,6 +3,7 @@
// Definitions by: Christopher Haws <https://github.com/ChristopherHaws>
// Leonard Thieu <https://github.com/leonard-thieu>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
/// <reference types="node"/>
@ -13,17 +14,17 @@ declare namespace GulpUglify {
/**
* Pass false to skip mangling names.
*/
mangle?: boolean;
mangle?: UglifyJS.MangleOptions | boolean;
/**
* Pass if you wish to specify additional output options. The defaults are optimized for best compression.
*/
output?: UglifyJS.BeautifierOptions;
output?: UglifyJS.OutputOptions;
/**
* Pass an object to specify custom compressor options. Pass false to skip compression completely.
*/
compress?: UglifyJS.CompressorOptions | boolean;
compress?: UglifyJS.CompressOptions | boolean;
}
}

View File

@ -14,12 +14,7 @@
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true,
"paths": {
"uglify-js": [
"uglify-js/v2"
]
}
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",

View File

@ -2,6 +2,7 @@
// Project: https://github.com/jonkemp/gulp-useref
// Definitions by: Tanguy Krotoff <https://github.com/tkrotoff>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
/// <reference types="node" />

View File

@ -14,10 +14,7 @@
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true,
"paths": {
"uglify-js": ["uglify-js/v2"]
}
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",

View File

@ -165,7 +165,7 @@ export interface OutputOptions {
indent_start?: boolean;
inline_script?: boolean;
keep_quoted_props?: boolean;
max_line_len?: boolean;
max_line_len?: boolean | number;
preamble?: string;
preserve_line?: boolean;
quote_keys?: boolean;

View File

@ -159,7 +159,7 @@ declare namespace UglifyJS {
/**
* Maximum line length (for non-beautified output)
*/
max_line_len?: number;
max_line_len?: boolean | number;
/**
* Output IE-safe code?