From e186620a60077acf7665174c663430f3a162d221 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABl=20M=C3=A9tais?= Date: Sun, 10 Jul 2016 15:15:45 +0800 Subject: [PATCH] Now that Uglify-JS is faster with already minified files... --- lib/tools/weightChecker/fileMinifier.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/tools/weightChecker/fileMinifier.js b/lib/tools/weightChecker/fileMinifier.js index 45dc14e..10d9efc 100644 --- a/lib/tools/weightChecker/fileMinifier.js +++ b/lib/tools/weightChecker/fileMinifier.js @@ -322,11 +322,11 @@ var FileMinifier = function() { // Avoid loosing some trying to compress JS files if they alreay look minified // by counting the number of lines compared to the total size. - // Less than 1KB per line is suspicious + // Less than 2KB per line is suspicious function looksAlreadyMinified(code) { var linesCount = code.split(/\r\n|\r|\n/).length; var linesRatio = code.length / linesCount; - var looksMinified = linesRatio > 1024; + var looksMinified = linesRatio > 2 * 1024; debug('Lines ratio is %d bytes per line', Math.round(linesRatio)); debug(looksMinified ? 'It looks already minified' : 'It doesn\'t look minified');