I'm developing a library that sometimes needs the classes exported to form an API and sometimes needs them minified.
To do this, I have multiple calls to goog.exportSymbol. This creates quite a few duplicates of my namespace name in the output file. For example, here is one line of the output file:
x("sometechie.media.MediaIsLiveStreamError",ye);x("sometechie.media.PlaybackStartedEvent",de);x("sometechie.media.PlaybackStoppedEvent",ee);x("sometechie.media.PlaybackPausedEvent",fe);x("sometechie.media.PlaybackResumedEvent",ge);x("sometechie.media.VolumeChangedEvent",he);x("sometechie.media.SourceChangedEvent",ie);x("sometechie.media.LoadProgressEvent",je);x("sometechie.media.PositionChangedEvent",ke);x("sometechie.media.ErrorOccurredEvent",le);
I am guessing that x is the minified name for goog.exportSymbol. It seems that the size of the output file could be reduced if sometechie.media could be defined only once and then the properties could just be added instead of having to refer to it multiple times, so that the output would be something like the following, where w is defined somewhere else in the code:
x("sometechie.media",w)w.MediaIsLiveStreamError=ye;w.PlaybackStartedEvent=de;w.PlaybackStoppedEvent=ee;w.PlaybackPausedEvent=fe;w.PlaybackResumedEvent=ge;w.VolumeChangedEvent=he;w.SourceChangedEvent=ie;w.LoadProgressEvent=je;w.PositionChangedEvent=ke;w.ErrorOccurredEvent=le;
I've tried to figure out how to do something like this, but is there any way to do this without causing incomplete namespace alias errors?