Having something like this:
(function ($, window, document, undefined) {
'use strict';
$.fn.demo = function (options) {
var active = "active";
var section = ".bb-demo";
$(section).addClass(active);
$(section).addClass(active);
$(section).addClass(active);
$(section).addClass(active);
};
})(jQuery, window, document);
Closure Simple mode results in 200 bytes:
(function(a,b,c,d){a.fn.demo=function(b){a(".bb-demo").addClass("active");a(".bb-demo").addClass("active");a(".bb-demo").addClass("active");a(".bb-demo").addClass("active")}})(jQuery,window,document);
While YUI compressor results in 169 bytes:
(function(c,b,a,d){c.fn.demo=function(e){var g="active";var f=".bb-demo";c(f).addClass(g);c(f).addClass(g);c(f).addClass(g);c(f).addClass(g)}})(jQuery,window,document);
Isn't there a way to compress those string variables in Closure as well? why isn't it doing it? Is it because of better results in terms of performance?