Have a look at the advanced compilation option: https://developers.google.com/closure/compiler/docs/api-tuto...
Basically when enabled it will rewrite normal property access, e.g: `myObj.foo` to something like `a.b` but wont shorten string literal access, e.g `myObj['foo']` just becomes `a.foo` which you would use for any API's you want to export.
For a real-world example I use string literals for declaring jquip's public API:
p['removeAttr'] = function(name){
return this['each'](function(){
if (this.nodeType == 1) this.removeAttribute(name);
});
};
Which closure advanced rewrites to: q.removeAttr=function(a){return this.each(function(){this.removeAttribute(a)})};
Original: https://github.com/mythz/jquip/blob/master/dist/jquip.all.jsCompiled: https://github.com/mythz/jquip/blob/master/dist/jquip.all.cl...