add warnings as toplevel shorthand

This commit is contained in:
alexlamsl 2017-04-14 23:51:09 +08:00
parent e6368b61a6
commit 0792c77564
2 changed files with 4 additions and 3 deletions

View File

@ -97,9 +97,8 @@ if (program.sourceMap && "base" in program.sourceMap) {
};
}();
}
if (program.verbose && options.compress) {
if (typeof options.compress != "object") options.compress = {};
options.compress.warnings = "verbose";
if (program.verbose) {
options.warnings = "verbose";
}
if (program.self) {
if (program.args.length) {

View File

@ -42,11 +42,13 @@ function minify(files, options) {
parse: {},
sourceMap: false,
toplevel: false,
warnings: true,
wrap: false,
}, true);
set_shorthand("ie8", options, [ "compress", "mangle", "output" ]);
set_shorthand("keep_fnames", options, [ "compress", "mangle" ]);
set_shorthand("toplevel", options, [ "compress", "mangle" ]);
set_shorthand("warnings", options, [ "compress" ]);
if (options.mangle) {
options.mangle = defaults(options.mangle, {
cache: null,