Skip to content

Commit

Permalink
Documentation and type definition: MinifyOptions.enclose (#1021)
Browse files Browse the repository at this point in the history
This patch updates the documentation to explain the existing
`enclose` option, and also modifies the type definition of
`MinifyOptions` to accept the `enclose` field.
  • Loading branch information
hanazuki committed Jul 10, 2021
1 parent d3d924f commit 6b62c00
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Expand Up @@ -530,6 +530,11 @@ try {
- `ecma` (default `undefined`) - pass `5`, `2015`, `2016`, etc to override
`compress` and `format`'s `ecma` options.

- `enclose` (default `false`) - pass `true`, or a string in the format
of `"args[:values]"`, where `args` and `values` are comma-separated
argument names and values, respectively, to embed the output in a big
function with the configurable arguments and values.

- `parse` (default `{}`) — pass an object if you wish to specify some
additional [parse options](#parse-options).

Expand Down Expand Up @@ -602,6 +607,7 @@ try {
// source map options
},
ecma: 5, // specify one of: 5, 2015, 2016, etc.
enclose: false, // or specify true, or "args:values"
keep_classnames: false,
keep_fnames: false,
ie8: false,
Expand Down
1 change: 1 addition & 0 deletions tools/terser.d.ts
Expand Up @@ -138,6 +138,7 @@ export enum OutputQuoteStyle {
export interface MinifyOptions {
compress?: boolean | CompressOptions;
ecma?: ECMA;
enclose?: boolean | string;
ie8?: boolean;
keep_classnames?: boolean | RegExp;
keep_fnames?: boolean | RegExp;
Expand Down

0 comments on commit 6b62c00

Please sign in to comment.