Google Closure Compiler Not Compressing String Values?
Having something like this: (function ($, window, document, undefined) { 'use strict'; $.fn.demo = function (options) { var active = 'active'; var section
Solution 1:
This is covered is Closure Compiler FAQ. https://github.com/google/closure-compiler/wiki/FAQ#closure-compiler-inlined-all-my-strings-which-made-my-code-size-bigger-why-did-it-do-that
Closure Compiler assumes that you are using gzip compression. If you do not, you should. Configuring your server to gzip your code is one of the most effective and easiest optimizations that you can possibly do. The gzip algorithm works by trying to alias sequences of bytes in an optimal way. Aliasing strings manually almost always makes the compressed code size bigger, because it subverts gzip's own algorithm for aliasing. So Closure Compiler will (almost) always inline your strings when it can, because that will make your compressed code smaller.
Post a Comment for "Google Closure Compiler Not Compressing String Values?"