minifyify
minifyify copied to clipboard
Not optimal compression
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.
Thanks for reporting this. Im not sure whats the best way to solve it.
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.