Raise limit on code size before compacting (#4965)

This commit is contained in:
Brian Ng 2016-12-08 17:08:56 -06:00 committed by Henry Zhu
parent 16c84fb353
commit db04f99124

View File

@ -38,7 +38,7 @@ class Generator extends Printer {
* Normalize generator options, setting defaults.
*
* - Detects code indentation.
* - If `opts.compact = "auto"` and the code is over 100KB, `compact` will be set to `true`.
* - If `opts.compact = "auto"` and the code is over 500KB, `compact` will be set to `true`.
*/
function normalizeOptions(code, opts, tokens): Format {
@ -78,10 +78,10 @@ function normalizeOptions(code, opts, tokens): Format {
}
if (format.compact === "auto") {
format.compact = code.length > 100000; // 100KB
format.compact = code.length > 500000; // 500KB
if (format.compact) {
console.error("[BABEL] " + messages.get("codeGeneratorDeopt", opts.filename, "100KB"));
console.error("[BABEL] " + messages.get("codeGeneratorDeopt", opts.filename, "500KB"));
}
}