diff --git a/README.md b/README.md index 19a0cdb2..70018d47 100644 --- a/README.md +++ b/README.md @@ -111,6 +111,11 @@ a double dash to prevent input files being used as option arguments: --keep-fnames Do not mangle/drop function names. Useful for code relying on Function.prototype.name. --name-cache File to hold mangled name mappings. + --safari10 Support non-standard Safari 10/11. + Equivalent to setting `safari10: true` in `minify()` + for `mangle` and `output` options. + By default `uglify-es` will not work around + Safari 10/11 bugs. --self Build UglifyJS as a library (implies --wrap UglifyJS) --source-map [options] Enable source map/specify source map options: `base` Path to compute relative paths from input files. diff --git a/bin/uglifyjs b/bin/uglifyjs index 867df606..3ff9b254 100755 --- a/bin/uglifyjs +++ b/bin/uglifyjs @@ -50,6 +50,7 @@ program.option("--keep-classnames", "Do not mangle/drop class names."); program.option("--keep-fnames", "Do not mangle/drop function names. Useful for code relying on Function.prototype.name."); program.option("--name-cache ", "File to hold mangled name mappings."); program.option("--no-rename", "Disable symbol expansion."); +program.option("--safari10", "Support non-standard Safari 10."); program.option("--self", "Build UglifyJS as a library (implies --wrap UglifyJS)"); program.option("--source-map [options]", "Enable source map/specify source map options.", parse_source_map()); program.option("--timings", "Display operations run time on STDERR.") @@ -69,6 +70,7 @@ if (!program.output && program.sourceMap && program.sourceMap.url != "inline") { "ie8", "mangle", "rename", + "safari10", "sourceMap", "toplevel", "wrap" diff --git a/lib/minify.js b/lib/minify.js index 0fd6e1dc..4a6d120b 100644 --- a/lib/minify.js +++ b/lib/minify.js @@ -58,6 +58,7 @@ function minify(files, options) { output: {}, parse: {}, rename: undefined, + safari10: false, sourceMap: false, timings: false, toplevel: false, @@ -77,6 +78,7 @@ function minify(files, options) { set_shorthand("ie8", options, [ "compress", "mangle", "output" ]); set_shorthand("keep_classnames", options, [ "compress", "mangle" ]); set_shorthand("keep_fnames", options, [ "compress", "mangle" ]); + set_shorthand("safari10", options, [ "mangle", "output" ]); set_shorthand("toplevel", options, [ "compress", "mangle" ]); set_shorthand("warnings", options, [ "compress" ]); var quoted_props; diff --git a/test/mocha/cli.js b/test/mocha/cli.js index 0825b808..18f71d19 100644 --- a/test/mocha/cli.js +++ b/test/mocha/cli.js @@ -16,7 +16,7 @@ describe("bin/uglifyjs", function () { command += semver.satisfies(process.version, ">=4") ? "6" : "5"; command += ',passes=3,keep_fargs=false,unsafe --wrap WrappedUglifyJS'; - exec(command, function (err, stdout) { + exec(command, { maxBuffer: 1048576 }, function (err, stdout) { if (err) throw err; eval(stdout);