minifyify icon indicating copy to clipboard operation
minifyify copied to clipboard

Not optimal compression

Open iKBAHT opened this issue 9 years ago • 2 comments

Minify doesn't cut variable names which located in top scope. For example, "bigName" will not be cut, but "bigVarName" will be.

var bigName = require('./foo');
function bar() {
  var bigVarName = 3;
  return bigVarName + 2;
}
module.export = bar();

It happen because minify compresses file per file separately from each other. Uglify think that file content is global and didn't compress top scope variables. If wrap this example to immediately involve function, then file be compresses goodly.

iKBAHT avatar Apr 08 '15 11:04 iKBAHT

Thanks for reporting this. Im not sure whats the best way to solve it.

ben-ng avatar Apr 10 '15 18:04 ben-ng

I prefer minifyify exactly because it applies compression on per-file basis and I don't consider the top scope name non-mangling an issue. The top scope content is global in some sense.

illarionvk avatar Sep 20 '16 07:09 illarionvk