Skip to content

Commit

Permalink
🤖 Merge PR DefinitelyTyped#60694 update(uglify-js): v3.16 updates by @…
Browse files Browse the repository at this point in the history
…peterblazejewicz

- `module` options
mishoo/UglifyJS@c82fc1e

Thanks!
  • Loading branch information
peterblazejewicz authored Jun 10, 2022
1 parent 1a6747a commit f62e053
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
14 changes: 13 additions & 1 deletion types/uglify-js/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Type definitions for UglifyJS 3.13
// Type definitions for UglifyJS 3.16
// Project: https://github.com/mishoo/UglifyJS
// Definitions by: Alan Agius <https://github.com/alan-agius4>
// Tanguy Krotoff <https://github.com/tkrotoff>
Expand Down Expand Up @@ -170,6 +170,12 @@ export interface CompressOptions {
* @default true
*/
merge_vars?: boolean | undefined;
/**
* set to `true` if you wish to process input as ES module,
* i.e. implicit `"use strict";` alongside with `toplevel` enabled.
* @default false
*/
module?: boolean | undefined;
/**
* negate `Immediately-Called Function Expressions` where the return value is discarded,
* to avoid the parens that the code generator would insert.
Expand Down Expand Up @@ -429,6 +435,12 @@ export interface MinifyOptions {
* @default false
*/
toplevel?: boolean | undefined;
/**
* set to `true` if you wish to process input as ES module,
* i.e. implicit `"use strict";` alongside with `toplevel` enabled.
* @default false
*/
module?: boolean | undefined;
/**
* Pass an empty object {} or a previously used nameCache object
* if you wish to cache mangled variable and property names across multiple invocations of minify().
Expand Down
2 changes: 2 additions & 0 deletions types/uglify-js/uglify-js-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ const output = minify(code, {
},
passes: 2,
},
module: true,
nameCache: {},
});
if (output.warnings) {
Expand All @@ -62,6 +63,7 @@ const compressOptions: CompressOptions = {
keep_fargs: true,
loops: true,
merge_vars: true,
module: true,
negate_iife: true,
side_effects: true,
templates: false,
Expand Down

0 comments on commit f62e053

Please sign in to comment.