Browse Source

Now that Uglify-JS is faster with already minified files...

Gaël Métais 9 years ago
parent
commit
e186620a60
1 changed files with 2 additions and 2 deletions
  1. 2 2
      lib/tools/weightChecker/fileMinifier.js

+ 2 - 2
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
     // Avoid loosing some trying to compress JS files if they alreay look minified
     // by counting the number of lines compared to the total size.
     // 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) {
     function looksAlreadyMinified(code) {
         var linesCount = code.split(/\r\n|\r|\n/).length;
         var linesCount = code.split(/\r\n|\r|\n/).length;
         var linesRatio = code.length / linesCount;
         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('Lines ratio is %d bytes per line', Math.round(linesRatio));
         debug(looksMinified ? 'It looks already minified' : 'It doesn\'t look minified');
         debug(looksMinified ? 'It looks already minified' : 'It doesn\'t look minified');