Is there a way to reuse the legacy code so that I could export the module conditionally. Something like:
// in global DOM window context var foo = function()