re-introduce enclose (#3163)

fixes #2443
This commit is contained in:
Jiavan
2018-06-01 16:47:11 +08:00
committed by Alex Lam S.L
parent caf96acb08
commit b39043f3ab
7 changed files with 104 additions and 2 deletions

View File

@@ -55,6 +55,7 @@ function minify(files, options) {
try {
options = defaults(options, {
compress: {},
enclose: false,
ie8: false,
keep_fnames: false,
mangle: {},
@@ -157,6 +158,9 @@ function minify(files, options) {
if (options.wrap) {
toplevel = toplevel.wrap_commonjs(options.wrap);
}
if (options.enclose) {
toplevel = toplevel.wrap_enclose(options.enclose);
}
if (timings) timings.rename = Date.now();
if (options.rename) {
toplevel.figure_out_scope(options.mangle);